How to add foreign key relationship in Entity Framework?

后端 未结 3 1860
灰色年华
灰色年华 2020-12-04 14:19

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 creat

3条回答
  •  粉色の甜心
    2020-12-04 14:37

    If you are using the database first approach, it's better to create the foreign key on the database and update the model. Of course, this is true if you can modify the database; if not, you're stuck with the option of creating the referential constraint on the model.

提交回复
热议问题