使用非密钥添加关联

时间:2012-09-26 13:20:37

标签: c# entity-framework associations

我想使用非密钥手动添加资格认证 QualificationUnit 之间的关联。资格认证与QualificationUnit有零对多关系

我想加入OakQualificationNumber和QualificationNumber。

以下是我项目中的数据库结构和实体图。

enter image description here

我试图将它们联系起来,但我不能。我无法将PrincipalKey更改为OakQualificationNumber。你能告诉我如何添加非关键领域的协会吗?感谢。

enter image description here

1 个答案:

答案 0 :(得分:0)

这是不可能的。 EF不支持唯一约束,因为该主键只能是主键。