I managed to solve this problem without renaming classes, properties or metadata.
I had a project setup with a T4 transform that creates entity objects in a DAL project and a T4 transform that creates domain objects in a Domain project, and both referenced EDMX to create identical objects, and then I mapped DAL objects to Domain objects.,
The error occurred only when I referred to other classes (enumerations in my case) from the Domain assembly in my queries. When I removed them, the error was gone. It seems that EF was loading my domain assembly because of this, saw other classes with the same name, and exploded.
To solve this problem, I made a separate assembly that contained only my converted T4 domain classes. Since I never need to use them inside a query (only after a query for matching), I no longer have this problem. It seems cleaner and simpler than the answers below.
Carson Oct 02 '18 at 17:29 2018-10-02 17:29
source share