Entity Framework 6 does not create the mapping tables

c# entity-framework entity-framework-6 sql-server

Question

I am using an Entity Framework 6 ,I have some table as a mapping tables in the database - to map many to many tables - does not created as an entity when I create the model. what is the problem will be?

that's the tables:

Prop:
PK-Code
PropCh:
PK-CHID
and the mapping table:
Ch_Prop:
PK-CHID
PK-Code
1
0
2/27/2019 9:40:57 AM

Popular Answer

In your schema, the mapping table has no properties other than the FKs of the related entities, what makes it so to say a pure join table.

For this reason, EF does not creates a class to represent that "model", as entries of the table will be internally represented by the state of the navigation properties among the related models.

In most cases this isnt an issue, as normally entities are pre-loaded before being associated through modifications of their navigation properties.

1
2/27/2019 10:30:12 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow