C# – Entity Framework conflict with same table name from different databases

centity-framework

I am using Entity Framework 4 with MVC 3 in Visual Studio 2012 (C#).

I am using database first; there are two separate databases each with its own namespace and with two separate edmx files. Each database has a table with the same name and fields (but different content). When I added the second table I started to get compile errors.

Ambiguity between 'Interface.CodeFormStatus.FormStatusCodeID' 
and 'Interface.CodeFormStatus.FormStatusCodeID' 

There seem to be some complex workarounds or I could rename one of the tables. Is there not a straightforward solution as this must be a fairly common issue.

Best Answer

This worked for me. Just click on the table in the designer (the graphical version not the code) Then in the properties next to the, "Name" attribute you can change the name to something different. This will just change the name within the designer and used more as an alias throughout the application.