This happens because of EntityFramework While CSDL (Conceptual schema definition language , instance of the System.Data.Metadata) Entity mapping.
EntityFramework uses the class name & properties only, the namespaces are ignored in EDMX. We are unable to specify the exact class.
Here we have two different .edmx file in different folder with same table Customer.
This is ok while we compile our app, but this will cause an error while we are going any operation with this model.
Let’s create a Controller using EF
Click Next
This will cause this type of error.
Solution:
Simply create different .edmx file in same folder. Thus we can automatically manage our conflicted class in .tt file.
Let’s just remove the folder and create both .edmx file again with same table in both .edmx file.
Both .edmx file have same table Customer but they are referenced from a single class. As we know the namespaces are ignored in EDMX, this will act like a single .edmx file.
Both Models:
Customer Model
Employee Model
This is how we can separate our .edmx file using same table in multiple edmx.
Out Put:
Hope this will help 🙂