I'm trying to convert the following T-SQL query to linq2sql one. Whatever I do, it translates it to some nasty stuff with cross joins. Any suggestion?
Given tables A, B, C
SELECT A.Id, A.Name, Pool.Total
FROM A
INNER JOIN B ON A.Id = B.AId
LEFT JOIN (
SELECT AId,
SUM(Quantity) as Total
FROM C
GROUP BY AId) AS Pool ON A.Id = C.AId
WHERE Pool.Total < B.Threshold