I am getting the following error when executing one one of my LINQ queries
The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type 'Product'. Previously found CLR type 'TF.MyProject.DAL.Product, newly found CLR type 'TF.MyProject.DTO.Product'.
The Entity Framework generated class and the DTO object both are under their own namespace. This has worked previously and below is what I have tried so far...
Entity Framework version: 6.1.3
Below is how my current project is set up
Any idea or suggestions will be helpful. This has worked in my previous projects with version 6. Not sure if it is specific to a version within release 6..
Note: Moving the DAL to a project of its own resolves the issue
You have two classes with the same name
Product. Entity Framework uses Class Names only, irrespective of namespaces or files where it is declared. The error message clearly says you have two Product classes, one in
TF.MyProject.DAL namespace and another one in
Try renaming on of these
Product classes to some other name and try again.