以下linq表达式会出现一个warning:
The LINQ expression 'where ([a].GrPostDate.AddDays(Convert(value(Services.BookService).GetYNCPendingDay([a].Plant, __yncRuleList_0), Double)) <= __dtnow_1)' could not be translated and will be evaluated locally.
研究了半天不知道怎么优化,虽可以正常运行过去,但会吃服务器内存资源,下面贴出linq表达式:
var results = from a in ivItbrData
let yncPendingDay = GetYNCPendingDay (a.Plant, yncRuleList)
let grPostDate = a.GrPostDate.AddDays (yncPendingDay)
where!ivItbrMappingData.Any (o => o.Seq == a.Seq) && grPostDate <= dtnow select a;
请求大佬帮帮看看怎么优化,谢谢了,没豆子还请见谅~
直接手写sql,ef core暂时无法转译复杂linq