In a database I have two tables User and Organization as well as a bridging table Users_Orgs.
The Users_Orgs table has a composite key comprising of two columns userId and organizationId. When I use the designer to create an association it creates two principals for the referential constraint - Users and Users_Orgs. The problem is with the Users_Orgs constraint - it has a key comprising of both organizationId and userId. Since organizationId is not in the User table, it cannot be mapped and therefore won't compile.

When clicking the 'Delete' button the dialog just closes and organizationId is just mapped to the primary key for the users table (which is not userId)
How can you do many to many mappings with composite keys on an existing database?
Why do you have bridging table in your model? It is not needed if you don't have additional properties in this table. Otherwise you should just model relation between
UsersandOrganizationsand correctly configure many-to-many multiplicity. EF will automatically create bridging table and mapping for this relation.To solve your issue: Bridging table is dependent, not principal. Switch roles in the constraint and map
User.UserIdPK toUsers_Orgs.UserIdFK.