EF4 foreign key to unique key relationship not recognized

I have two tables A and B in my db with a foreign key in between. Table A has PrimaryKey and UniqueKey. Table B refers to table A using UniqueKey. If I generate an ef model from the database, an association between A and B is not created, and I could not find a way to manually add the association. However, Linq2Sql recognizes the relationship as expected. Any ideas?

+3
source share
1 answer

See this MSDN blog post: http://blogs.msdn.com/b/efdesign/archive/2011/03/09/unique-constraints-in-the-entity-framework.aspx . In short, this is not supported in V4, although the EF team has plans to support it in future releases.

+3

Source: https://habr.com/ru/post/1783542/


All Articles