CLR型与EDM型的映射与EF 6& 5? [英] The mapping of CLR type to EDM type is ambiguous with EF 6 & 5?

查看:297
本文介绍了CLR型与EDM型的映射与EF 6& 5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请任何人帮我解决这个错误?

Please any one can help me to fix this error?


指定的模式无效。错误:

Schema specified is not valid. Errors:

CLR类型到EDM类型的映射是不明确的,因为多个CLR类型与EDM类型City_DAL匹配。以前发现的CLR类型'CeossDAL.City_DAL',新发现的CLR类型'CeossBLL.City_DAL'。

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

我有DAL的主要问题这包含EF和BLL,它包含DAL的相同类别,但命名空间不同,这是什么原因导致问题

The main problem that I have DAL and this contains the EF and BLL and this contains the same classes of the DAL but differ in the namespace and this is what cause the problem

我不知道如何摆脱这些问题,可以帮助我吗?

I can't know how to get rid of these problem, can you please help me?

此外,我将不胜感激,如果有人给我示例使用EF层架构与EF

Also I will be appreciated if some one give me sample to use n-tier architecture with EF

谢谢

推荐答案

不要使用相同的不合格的类name - EF仅使用类名来标识EDMX中映射的类型(命名空间被忽略) - 允许将类映射到不同命名空间到一个模型的约定。您的问题的解决方案是以BLL命名您的课程。

Don't use classes with the same unqualified name - EF uses only class names to identify the type mapped in EDMX (namespaces are ignored) - it is a convention to allow mapping classes from different namespaces to single model. The solution for your problem is to name your classes in BLL differently.

这篇关于CLR型与EDM型的映射与EF 6& 5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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