I need to rewrite the query below using Linq to Entity. Can anyone help? I’ve looked up many examples, but I still don’t get it.
SELECT Realizators.Surname, SUM(Sales.CopyNumber)
FROM Realizators, Sales
WHERE Realizators.WorkerID = Sales.WorkerID
GROUP BY Surname;
I think it could be translated to something like this:
The double sum is because you are adding up all the copy numbers of all the sales of all the workers with the same surname. I’m not so sure if that’s the purpose of the original query.