CLR类型EDM类型的映射是模棱两可与EF 6安培; 5?

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。 previously发现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?

此外,我会AP preciated如果有一个人给我品尝到使用与EF n层架构

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

感谢您

不要使用相同的名称使用类 - EF只使用类名来识别EDMX(命名空间将被忽略)映射的类型 - 这是一个约定,允许从不同的命名空间,以单一的模式映射类。你的问题的解决方案是在BLL不同的命名类。

Don't use classes with the same 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.