开发者

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:

Entity Framework 4: Can't add Referential Constraint to Assiciation with Model First and GUID Ids

These are the properties of their association:

Entity Framework 4: Can't add Referential Constraint to Assiciation with Model First and GUID Ids

And this is the "Referential Constraint Dialog":

Entity Framework 4: Can't add Referential Constraint to Assiciation with Model First and GUID Ids

As you can see: There is no FK to select as "Dependent Property"... In the database there is a FK column for that:

Entity Framework 4: Can't add Referential Constraint to Assiciation with Model First and GUID Ids

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜