Ok, I have tri-leveled entities with the following hierarchy: Course -> Module -> Chapter
以下是最初的EF LINQ声明:
Course course = db.Courses
.Include(i => i.Modules.Select(s => s.Chapters))
.Single(x => x.Id == id);
现在,我想包括另一个与课程相关的实体,名为Lab.
如何包含Lab实体?
我try 了以下方法,但没有成功:
Course course = db.Courses
.Include(i => i.Modules.Select(s => s.Chapters) && i.Lab)
.Single(x => x.Id == id);
对加入第二实体有什么 idea 吗?
任何建议或信息都将不胜感激.谢谢