我有一个小问题,不太清楚该如何解决。在下面的示例中,我想选择一组包含已激活ProductItems的ProductCategories列表。
public IEnumerable<ProductCategory> ListProductCategories()
{
return _entities.ProductCategorySet.Include("ProductItems").Where(x => x.ProductItems.Active == true).ToList();
}
问题是我无法在lambda表达式中访问productItem属性Active,这是什么问题?当我尝试编写类似上面的linq查询时,我是否完全想错了?