小编Dee*_*Raj的帖子

不支持嵌套查询。操作1='GroupBy' 操作2='MultiStreamNest'

这是在 linqpad 中运行的 linq,我没有收到任何错误,但是当我运行我们的项目时,我收到此错误(不支持嵌套查询。Operation1='GroupBy' Operation2='MultiStreamNest'),您可以给出解决方案吗?

  var ledgerReport = (from i in db.Items
             join si in db.SalesInvoiceDetails on i.ItemCode equals si.ItemCode
             join cat in db.categories on i.catCode equals cat.catCode
             join locw in
                 (from loc in db.LocationStocks
                  group loc by new { loc.ItemCode } into g1
                  select new { Qty1 = (Decimal?)g1.Sum(x => x.Qty) ?? 0, g1.Key.ItemCode }) on i.ItemCode equals locw.ItemCode into we
             where si.DispatchDate >= startdate && si.DispatchDate <= enddate
             group si by new
             {
                 si.ItemCode,
                 i.Description,
                 Qtt = (Decimal?)we.Sum(x …
Run Code Online (Sandbox Code Playgroud)

linq linq-to-entities entity-framework linq-to-sql

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