c# - Linq to SQL many-to-many relationship without a third class -


in database have following tables:

  • customers (id)
  • orders (id)
  • customersorders (customerid, orderid)

how map customers table customers class , orders table orders class without creating class customersorders?

that depends on linq version you're talking about.

if you're using entity framework 4.0 , have no additional information in table other ids asking should generated. believe same true entity framework 1.0.

linq sql story. never handled many-to-many relationships well. have allow linq sql generate third table , extend partial classes hand in separate file mask away third table. it's ugly works. here's series of blog posts detail needs done:

how implement many-to-many relationship using linq sql


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -