This page describes all steps to edit RC:
http://msdn.microsoft.com/en-us/library/dd456813.aspx
Those are easy steps, pretty intuitive for anyone working with database. However, when I try to edit it, I can change the principal component (as described), and:
- the dependent is filled automatically, I cannot set it manually
- I cannot set principal key
- I cannot set dependant key
The grid for keys is simply dead, I cannot even click on it.
I try to re-establish RC, after I accidentally altered it (by introducing base class for the tables).
The question — why I cannot edit RC now, and how to fix this problem?
One "solution" is to delete all affected tables from the model and update the model from the database (see: http://www.mikelindegardeonline.com/2011/03/03/entity-framework-insufficient-mapping-error/). But this ruin all my other changes.
.Net 4.0.
SOLVED
I didn’t notice missing small key icon next to fields. When I added base class not only it affected relations but also key fields. Without key fields I couldn’t fix the relations.
Open your EDMX file in the XML editor (right-click it in the Solution Explorer, select “Open With …” and then “XML Editor”).
Then you can change anything. Make sure you go through the entire document; some changes you have to perform in multiple places.