So here is the original query
SELECT SUM(PickQty), SUM(ReqQty), AssignmentID, StopID FROM PickRequest GROUP BY AssignmentID, StopID
in LINQ
from a in dbReqs
group a by new { a.AssignmentID, a.StopID }
into pr
select new
{
Assignment = pr.Key,
StopID = pr.Select(s=> s.StopID),
PickQty = pr.Sum(p=> p.PickedQty),
Count = pr.Sum(c => c.ReqQty)
}
I must be doing something wrong because the LINQ version takes ages and the results seem a bit off. Ideas?