我想使用 Entityframework Plus访问Parent
它唯一的活跃Children
和活跃的Grand Children
关系
父 -> 子 -> 孙子
var parent = await _dbContext.Parent
.IncludeFilter(p=>p.Children.Where(c=>c.IsActive == true))
.IncludeFilter(p=>p.Children.Select(c=>c.GrandChildren.Where(gc=>gc.IsActive ==true)))
.Where(p=>p.ParnetID == 1234)
.SingleOrDefaultAsync()
上面的查询不起作用。孩子不会被过滤。它返回所有孩子,包括不活动的孩子。但是 GrandChildren 会被过滤(但是我猜 Grand Childeren 会在内存中被过滤,而不是在 sql 中)