c# - 在哪里可以找到 Linq ThenInclude 方法?

标签 c# entity-framework linq model-view-controller

我看到一些包含 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)

最佳答案

ThenInclude是 Entity Framework Core (EF 7) 的一部分。

关于c# - 在哪里可以找到 Linq ThenInclude 方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41367534/

相关文章:

c# - TextRenderer.MeasureText() 和文本框最大文本长度

.net - 当我发出 “SaveChanges()” 时,Entity Framework 中的默认事务隔离级别是什么?

c# - Entity Framework 不保存所有更改

c# - 如何解决 'Only Parameterless constructors and initializers...' 错误

c# - 如何更改方法签名/属性以匹配给定的执行示例?

c# - 数据契约(Contract)序列化器可以用于任何第三方网络服务吗

c# - XML 节点最新时间戳 C#

c# - 两个流的条件配对 - 在响应式扩展中组合 If

c# - 如何使用C#验证WebHDFS

mysql - Linq 返回外键引用的数据