我有一个简单的查询,我想这样做:实体框架预先加载器
1)Products
有ChildProducts
具有PriceTiers
2)我想所有的Products
有一个Category
与ID
1和Display
= true。
3)我想包括所有ChildProducts
有Display
=真。
4)然后包含PriceTiers
的IsActive
= true。
从我已阅读,EF不支持预先加载有过滤器,所以下面将不工作:
ProductRepository.Query.IncludeCollection(Function(x) x.ChildProducts.Where(Function(y) y.Display).Select(Function(z) z.PriceTiers.Where(Function(q) q.IsActive))).Where(Function(x) x.Categories.Any(Function(y) y.ID = ID)))
有什么建议?
为什么你开始针对同一问题的多个问题?而且你为什么一次又一次地做呢? – 2011-04-14 08:25:29