In an app with EF6.0, I have two DbContext's created by model first, Schema1.DbContext1
and Schema2.DbContext2
.
Now I need to do a join on two entities, EntityA
from Schema1.DbContext1
and EntityB
from Schema2.DbContext2
.
How can I do this?
If you can use stored procedures, this is a case for it. The proc can join the two entities at the database level across databases. Whichever db is appropriate, you can then map that proc in your entities model and use it. I say 'if you can' because I've seen shops that prohibit all SP's in favor of only EF.