Framework中添加外键关系

Framework中添加外键关系

本文介绍了如何在Entity Framework中添加外键关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

,创建外键关联的步骤如下:

...一定要检查添加外部填写关系详细信息时,实体复选框的关键属性。



另请参见:


Click here to see how to do it while using a code first approach. Below the original database first approach question and answer.

I am using Entity Designer to create a database first model. Now I want to create a foreign key relationship between ProductId and ProductId (see below). I looked at the "add new association" but I cannot connect the two items. Can someone more experienced tell me how to accomplish this?

解决方案

According to Relationships/Associations with the EF Designer, the steps to create a foreign key association are:

...being sure to check the Add foreign key properties to the Entity checkbox when filling in the relationship details.

See also: Relationships, Navigation Properties, and Foreign Keys

这篇关于如何在Entity Framework中添加外键关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 03:06