Entity Framework foreign keys to non-primary key f

2019-02-16 12:43发布

Is it possible for Entity Framework 4.0 to have an association/navigation property based off of a foreign key to a non-primary key field (it has a unique constraint).

1条回答
聊天终结者
2楼-- · 2019-02-16 13:21

No because EF don't understand unique constraint yet and relations in EF must follow same rules as relations in database. Without unique principal relation cannot exist and the only way to get unique principal in EF is using primary key.

查看更多
登录 后发表回答