2 回答

TA貢獻(xiàn)1847條經(jīng)驗(yàn) 獲得超7個(gè)贊
AllotDetail dbdinner join這里是不是錯(cuò)了?
AllotDetail dbd inner join??
var result = ctx.AllotDetail.GroupJoin
(
ctx.OutputRec,
a => a.AllotRecID,
o => o.AllotRectID,
(a, c) =>
new
{
ProductID = a.ProductID,
Weight = c.Sum(s => s.Weight)
});

TA貢獻(xiàn)2016條經(jīng)驗(yàn) 獲得超9個(gè)贊
大概這么個(gè)意思,照著你的sql手寫(xiě)的,寫(xiě)錯(cuò)了就自己改改:
from p in AllotDetail
from q in OutputRec
group p by p.AllotRecID,p.ProductID,p.Weight into g
where g.Weight > weight
select new {
AllotRecID,ProductID,
weight = g.Sum(p => p.Weight)
}
- 2 回答
- 0 關(guān)注
- 562 瀏覽
添加回答
舉報(bào)