简体   繁体   English

多对多表首先与EF6数据库映射为一个实体

[英]Many-to-Many table is mapped as an entity with EF6 database first

I have an Issue with Many-to-Many mapping. 我有一个多对多映射问题。 I have the following tables created on MySql database: 我在MySql数据库上创建了以下表:

创建表

In edmx I tried to map it with Update Model From Database: 在edmx中,我尝试将其与数据库更新模型映射:

映射表

But when the tables are mapped, the table Many-to-Many usuarios_conquistas is mapped as an Entity (not only a relationship between tables usuarios and conquistas ): 但是,在映射表时,表多对多usuarios_conquistas被映射为一个实体(不仅是表usuariosconquistas之间的关系):

映射表

Anyone knows what I'm doing wrong? 有人知道我在做什么错吗?

“ usuario_conquistas”表不应具有列ID,而应使用列IdUsuario和IdConquista作为组合主键。

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

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