相关疑难解决方法(0)

实体框架核心SelectMany然后包括

我似乎无法弄清楚如何在使用SelectMany时让EF Core包含/加载相关对象.

context.MyObject
       .Where(w => w.Id == Id)
       .SelectMany(m => m.SubObject)
       .Include(i => i.AnotherType)
Run Code Online (Sandbox Code Playgroud)

本来会想到类似上面的东西会起作用,但是折叠的SubObject集合使AnotherObject为null并且不包括在内.

一直在寻找几个小时.

任何帮助,将不胜感激.

谢谢

c# entity-framework-core .net-core

5
推荐指数
1
解决办法
3475
查看次数

标签 统计

.net-core ×1

c# ×1

entity-framework-core ×1