views:

3223

answers:

2

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.

+2  A: 

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.

Craig Stuntz
Do you know if the generated SQL goes cross database or does it handle it as a call to database a, then a call to database b?
DeletedAccount
+1  A: 

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

BritishDeveloper