简体   繁体   中英

The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM

Previously I had only one entity context so the linq query was working well. Now we have splited the database into two sections, so I deleted the tables in the previous context and added another new entity context of the deleted tables, but when I run my application it shows the following error:

The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type 'SUP_ExSubGroupTable'. Previously found CLR type 'Supporter24Model.SUP_ExSubGroupTable', newly found CLR type 'SUP_ExSubGroupTable'.

Thanks in advance.

I solved it by myself

by deleting the schema of duplicate tables

in the other context

example:: my entitymodel name is employee

in my project i created modelclass name as employee...So this error will occur

Solution is...> just modifying the modelclass name to different name...bcz our enitymodel is same..so we have to modify our project modelclass name to differenet name

Your Generated Entity type should be match every where, means you can not change the name of generated entity type.

I have changed the name of entity generated by EF Database first approach, and started getting above error, once I revert back issue is resolved. Because you can change the name but EF keep the reference at multiple place thatsy it give error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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