[英]Is it possible to have Where or Any expression inside Include in Linq or Lambda expression?
Something similar to this类似的东西
Ex前任
var temp = dbcontext.ModelA.include(x=>x.ModelB.where(...))
var temp = dbcontext.ModelA.include(x=>x.ModelB.Any(...))
Yes filtered includes are supported, but only as of EF Core 5.0, which would allow you to use Where
.是的,支持过滤包含,但仅从 EF Core 5.0 开始,这将允许您使用Where
。
According to the docs:根据文档:
Supported operations are:
Where
,OrderBy
,OrderByDescending
,ThenBy
,ThenByDescending
,Skip
, andTake
.支持的操作有:Where
、OrderBy
、OrderByDescending
、ThenBy
、ThenByDescending
、Skip
和Take
。
However, using Any
directly does not make sense, because it returns bool
rather than a subset of related entities.但是,直接使用Any
没有意义,因为它返回bool
而不是相关实体的子集。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.