开发者

Unable to add foreign keys manually in Entity Framework 4

开发者 https://www.devze.com 2023-01-05 16:27 出处:网络
So I have a sql server 2008 database with 9 tables in them, they don\'t have any set relationships but is still used as if they have it, this however makes it so that I cant import the relationships w

So I have a sql server 2008 database with 9 tables in them, they don't have any set relationships but is still used as if they have it, this however makes it so that I cant import the relationships when importing the models from the database.

Now, when trying to add an ass开发者_StackOverflow中文版ociation between two tables work but when I want to point tb1.Id -> tb2.fkid it forces tb1.Id -> tb2.Id instead, I'm unable to choose anything else besides Id in both tables and I cant delete them either (from the menu after clicking the association line between the tables).

So is it possible to make these "fake" relationships? if so what am I missing?


After some more looking into it I found the answer, clicking on the association line and choose table mapping, then I started to fiddle around and it enabled me to choose the right column.

0

精彩评论

暂无评论...
验证码 换一张
取 消