I would like to map all many-to-may relations through a single table in my database.
Meaning that I have numerous tables (entities) that have various many-to-many relations. Instead of having a separate mapping table for every relation I would like to use one “master mapping” table having to columns: End1Id & End2Id.
Don’t ask why 😉 It’s required by my customer…
How would I set this up in the model designer, or do I have to edit the edmx xml directly….or is it just not possible?
Thanx for your help!
In such a scenario you can’t have explicit foreign keys, because a table like this normally has at least three rows:
Because of that, you can just create a table in EF, but it will also have no connections to other tables and you will have to do the joins manually.