2 回答

TA貢獻1847條經驗 獲得超7個贊
AllotDetail dbdinner join這里是不是錯了?
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貢獻2016條經驗 獲得超9個贊
大概這么個意思,照著你的sql手寫的,寫錯了就自己改改:
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 關注
- 559 瀏覽
添加回答
舉報