Create a many to many relationship in Entity Framework skipping extra data in the link table.
- by Paul Smith
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 understand 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.