When Entity Framework locates a link table that only holds foreign keys to two other tables it will omit the table from the model and instead create an n-to-m relation on the tables that are linked.
So in your model you would expect:
- Customer has n CustomerLocations
- Location has n CustomerLocations
- CustomerLocation has 1 Customer
- CustomerLocation has 1 Location
Instead it creates the following:
- Customer has n Locations
- Location has n Customers
In this case to create a CustomerLocation it would be enough to add a Location to the Customers Locations or add a Customer to the Locations Customers.
If you really need the CustomerLocation table consider giving it an extra column, for example an ID field.
In this case your Entity Model won't create the n-to-m relation on Customer and Location, but instead create the CustomerLocation table and give the 'expected' output.
I know this because I've had the same 'problem' when I first started using Entity Framework :)
Here's a link that also explains this:
Lack of a many-to-many linking table in EF 4.0 a bug or a feature?[
^]