Entity Framework magically interprets the following table structure as a many-to-many relationship.
table foo (int id)
table foo_bar (int foo_id, int bar_id)
table bar (int id)
But if the join table has any additional fields it will instead be interpreted as two one-to-many relationships.
I am using a database in which the join table has a surrogate key as primary key. Because of this EF interprets it as two one-to-many relationships.
table foo (int id)
table foo_bar (int surrogate_pk, int foo_id, int bar_id)
table bar (int id)
Is it possible to modify EF:s interpretation to make it an actual many-to-many relationship in the model? Can it be done using the designer?