Entity Framework - Add Navigation Property Manually

后端 未结 2 1515
逝去的感伤
逝去的感伤 2020-11-28 01:28

I generated an Entity Framework Model (4.0) from my database. I did not design the database and do not have any control over the schema, but there are a few tables that do n

2条回答
  •  被撕碎了的回忆
    2020-11-28 01:53

    I came across this blog post which proposes the following solution, which worked great for me (unfortunately I could not get RPM1984's to work in my situation).

    1. Add an Association via designer background right click contextual menu
    2. Set up your Association (be sure to uncheck creation of foreign key)
    3. Right click on the association and choose Properties
    4. Click on the ... button for Referential Constraint
    5. Set up the relation between the keys within
    6. Verify (from the designer contextual menu)
    7. ???
    8. Profit!

提交回复
热议问题