Search code examples
sql-serverentity-frameworknaming-conventionsentity-relationship

Entity Framework naming conventions for many-to-many link tables


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


Solution

  • 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