Entity Framework 4: Can't add Referential Constraint to Assiciation with Model First and GUID Ids
I read a lot of examples and tutorials about adding referential constraints but my designer just doesn't give me the FK I would need to select. I'm using model first and all my IDs ar开发者_运维百科e GUIDs.
These are the two entities:
These are the properties of their association:
And this is the "Referential Constraint Dialog":
As you can see: There is no FK to select as "Dependent Property"... In the database there is a FK column for that:
What am I doing wrong?
Thanx
Because your entity doesn't have any FK property. You must first create the property which will be used as your FK and select it in Dependent Property drop down (it shows only existing properties of dependent entity).
精彩评论