简体   繁体   English

实体框架6不创建映射表

[英]Entity Framework 6 does not create the mapping tables

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. 我正在使用Entity Framework 6,我在数据库中有一些表作为映射表-映射许多表-在创建模型时未作为实体创建。 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

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 . 在您的模式中,映射表除了相关实体的FK之外没有其他属性,因此可以说是联接

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. 由于这个原因,EF不会创建代表该“模型”的类,因为表的条目将由相关模型之间的导航属性的状态内部表示。

In most cases this isnt an issue, as normally entities are pre-loaded before being associated through modifications of their navigation properties. 在大多数情况下,这不是问题,因为通常实体是在通过修改其导航属性进行关联之前预先加载的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM