I have 3 tables: table1 with columns(ProductId, name, etc), table2 (DocumentId, name, etc), table3 (ProductId, documentId). When I create a .edmx model I have only table1 and table2 in my model, I can’t see table3. How can I get the Documents for Products if the table3 is missing?
I have 3 tables: table1 with columns(ProductId, name, etc), table2 (DocumentId, name, etc), table3
Share
See that when you create the model, you have both in Products, a property called Documents, and in Documents, a property called Products.
To see Documents in a Product, then call:
and the same for products
and then you will have Products as a collection for each Document and Documents as a collection for each Product
This happends to every Many to Many table in EF.