ITPub博客

首页 > > > ef core , linq提示could not be translated and will b

ef core , linq提示could not be translated and will b

作者:karspb 时间:2019-10-29 17:43:47 0 删除 编辑

以下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;

请求大佬帮帮看看怎么优化,谢谢了,没豆子还请见谅~

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2001/viewspace-3121513/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-07-31

  • 博文量
    222
  • 访问量
    16819