I have two databases I need to access(and maybe more in the future).
For the first one I have created an ADO.NET Entity Data Model and then EF DBContext
Generator from it. Everything works perfect.
For the second database I do the same. No errors.
However in both databases I have a table Clients
and the problem that I have is that the Clients
model generated from the second database overwrites the Clients
model from the first one and I get errors in the MVC project.
How can I go about this issue?
Edit: I have done as teo van kot suggested(at first created the folders in Models than in root folder) and seemed to work at first glance, but when I run the app I get this:
Schema specified is not valid. Errors: The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type 'Clients'. Previously found CLR type 'test.dbWCF.Clients', newly found CLR type 'test.dbSBD.Clients'.
As @Gert Arnold pointed, indeed I "fixed" with this dirty workaround:
Workaround: Change a property on one of the two identical classes.
EF matches on class name AND class properties. So I just changed a property name on one of the EF objects, and the error is gone.