I would like to model the following many to many relationship.
Table A
ID
Field1
Field2
Table B
ID
Field1
Field2
LinkTable
A_ID
B_ID
Field_I_want_to_ignore
As I understan开发者_Python百科d it, if LinkTable.Field_I_want_to_ignore was not present, the Entity Model Designer would automatically create a Many to Many relationship between entity A and entity B. However, because this field exists in the database the designer won't do it for me.
I can delete the Field_I_want_to_ignore from the LinkTable Entity that the designer created for me, but how do I eliminate the LinkTable entity altogether and create the many to many relationship I want?
I'm not averse to digging through the XML, just at the moment I can't see how to achieve what I want.
IMHO the simplest way is this:
- Back up your DB.
- Restore the DB elsewhere.
- Drop the field.
- Generate a model.
The new model will work just fine with the "real" DB.
Yes, it's possible to do this by digging through XML/EDMX, but it's complicated, as it changes CSDL, MSL, and SSDL.
Whereas the steps above can be done in a script.
精彩评论