CLR类型到EDM类型的映射是不明确的 [英] The mapping of CLR type to EDM type is ambiguous

查看:320
本文介绍了CLR类型到EDM类型的映射是不明确的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

指定的架构无效。错误:



CLR类型到EDM类型的映射是不明确的,因为多个CLR类型与EDM类型CmnAddressCity匹配。



之前发现CLR类型'ABS.Models.Sales.CmnAddressCity',

新发现的CLR类型'ABS.Models.SystemTools.CmnAddressCity'。

有什么解决方案吗?



我尝试过:



i不知道。我想强烈地输入类引用,但那是个坏主意。

Schema specified is not valid. Errors:

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

Previously found CLR type 'ABS.Models.Sales.CmnAddressCity',
newly found CLR type 'ABS.Models.SystemTools.CmnAddressCity'.
Is there any solution?

What I have tried:

i have no idea. i was thinking to type the class reference strongly, but that was bad idea.

推荐答案

你已经收到了关于你在C#Corner的帖子的答案,它引导你到这里发布 - c# - CLR类型到EDM类型的映射与EF 6& amp; 5? - 堆栈溢出 [ ^ ]
You have already received an answer to your post on C# Corner which directs you to this post - c# - The mapping of CLR type to EDM type is ambiguous with EF 6 & 5? - Stack Overflow[^]


Just add the EntityFramework as "Code First from database" and not as "EF Designer from database". This resolved my problem, but it has a dark side, if you change your database you have to remove all the classes and add it again, or just edit the classes, I use the last when I change properties of the columns, like "Allows null" or the size of a string. But if you add columns I recomend remove and add again the classes.


这篇关于CLR类型到EDM类型的映射是不明确的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆