![](/img/trans.png)
[英]Net Core: Async method with ThenInclude Filter and Where
[英]Where can I find Linq ThenInclude method?
我看到了一些包含ThenInclude的 LINQ代码示例。 在哪里可以找到这种方法? 在外部库或其他命名空间中。
我想使用这种方法获取派生数据,但是我找不到这种方法,或者您知道其他解决方案吗
return _dbContext.Goals
.Where(p => p.Owner.Id == userId)
.Include(p => p.GoalExpectation)
.ThenInclude<RangeGoalExpectation>(p => p.MinValue)
.ThenInclude<RangeGoalExpectation>(p => p.MaxValue)
.ThenInclude<SpecifiedGoalExpectation>(p => p.Value)
然后,Include是Entity Framework Core(EF 7)的一部分。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.