我在使用 Entity Framework 时有以下 Linq 查询。
var res = from a in _db.Articles
from auth in a.Authors
where papers.Contains(a.JoomlaId)
select auth.Institution;
问题是我的机构类有一个名为“Type
”的变量,类型为“InstitutionType
”,我需要包含它,但我不知道该怎么做那个。
最佳答案
var res = from a in _db.Articles.Include("Authors")
.Include("Authors.Institution")
.Include("Authors.Institution.Type")
from auth in a.Authors
where papers.Contains(a.JoomlaId)
select auth.Institution;
关于c# - Entity Framework linq 包括,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17285924/