Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linq to Entities / Entity Framework cross edmx "join"

Tags:

I have two entities, each from a different database and therefore different edmx files. There is, however, an infered relationship between them.

Foo has many Bars for example.

What's the easiest way to do this join in the EntityFramework, with fewest database calls?

Thanks.

like image 309
NikolaiDante Avatar asked Dec 18 '08 11:12

NikolaiDante


2 Answers

You can do this by adding cross-model navigation properties. This requires manually editing the EDMX. There is an example, including LINQ to Entities, here.

like image 181
Craig Stuntz Avatar answered Sep 30 '22 16:09

Craig Stuntz


You can do this by using Views to represent data in the other database. Read about cross database joins in EF

like image 28
BritishDeveloper Avatar answered Sep 30 '22 15:09

BritishDeveloper