Entity Framework 4.0 with tables from 2 different Database Servers
Posted on 2014-01-27
I am new to EF and am trying to develop a small application using MVC and EF. My application needs to display a list of employees that exist in a table stored in MS SQL Server 2008. The table has the following fields:
ENL_ContactID (PK, int, not null)
ENL_EMP_ProfileID (int, not null)
ENL_GroupNameID (int, not null)
The ENL_GroupNameID exists in another MS SQL Server table and is in the same model as the ENL_Contacts Table. The ENL_EMP_ProfileID is a key into an Employee Table that exists in an Oracle DB. I created a second model that brings in the Employee Table from the Oracle DB.
The EMP_Employee Table in the Oracle DB contains the following fields that are needed by my application:
EmployeeID (PK, int, not null)
FirstName (varchar(50), not null)
LastName (varchar(50), not null)
(the rest of the fields are not displayed)
How can I create a "View" that joins the ENL_Contacts Table from the ENL Model with the Employee Table from the EMP Model?
I want to be able to display the following:
ENL_ContactID, ENL_EMP_ProfileID, LastName, FirstName, ENL_GroupNameID
Any help or suggestions is greatly appreciated.