views:

239

answers:

1

Hi,

We are designing a SQL Server database with link tables for many-to-many relations. The question is are there any best practices for naming these kinds of tables for use with the entity framework?

Let's say there's a table

Customer and Address

Then there is a link table between them, what do we call it? CustomerAddress ? Or something else?

Thnx

+1  A: 

For example, users - UsersInRoles - Roles. If CustomerAddress does not contains anything except CustomerID and AddressID, EF'll generate only two entities Customer (with Addresses property) and Address (with Customers) and there is no any matter how you call this intermediate table

Nagg
Ok that is sweet, and what about the situation where there is an additional value (which is also part of the primary key but not a FK from another table)
TimothyP
EF'll generate 3 entities (as Linq2sql) with same associations Customer - CustomerAddress - Address, and you can manually "remap" it as you like.
Nagg