映射在EF 4的外键,而无需创建一个新的EDMX文件
问题描述:
我通过取消对外国创造的entites的选项创建EDMX文件keys.So没有映射为我的外键的字段。是否有可能映射外键,而无需创建一个新的EDMX文件?如果可能的话如何?我从我already.I正在使用VS 2012 .Thanks数据库中创建的.edmx。
I created edmx file by unchecking the option for creating entites for foreign keys.So there is no mapping for my foreign key fields. Is it possible to map foreign keys without creating a new edmx file ? If possible How.? I created .edmx from a database which I had already.I am using VS 2012 .Thanks .
答
右键单击EDMX,从数据库中击中更新模型。还有的在那里外键的复选框。这就是你要找的是什么?
Right click in the edmx, hit update model from database. There's a checkbox for foreign keys in there. Is that what you're looking for?