Linq to Entities/Entity Framework cross edmx"join" [英] Linq to Entities / Entity Framework cross edmx "join"
本文介绍了Linq to Entities/Entity Framework cross edmx"join"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两个实体,每个实体来自不同的数据库,因此具有不同的edmx文件.但是,它们之间存在推断的关系.
I have two entities, each from a different database and therefore different edmx files. There is, however, an infered relationship between them.
Foo
例如有许多Bar
.
在EntityFramework中以最少的数据库调用进行连接的最简单方法是什么?
What's the easiest way to do this join in the EntityFramework, with fewest database calls?
谢谢.
推荐答案
您可以通过添加跨模型导航属性来做到这一点.这需要手动编辑EDMX.有一个示例,包括LINQ to Entities,
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.
这篇关于Linq to Entities/Entity Framework cross edmx"join"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文