How to: LINQ - Left Join, Group By, and Count #dev #development #answer
How to: LINQ ā Left Join, Group By, and Count #dev #developmentĀ #answer
LINQ ā Left Join, Group By, and Count
Letās say I have this SQL:
SELECT p.ParentId, COUNT(c.ChildId) FROM ParentTable p LEFT OUTER JOIN ChildTable c ON p.ParentId = c.ChildParentId GROUP BY p.ParentId
How can I translate this into LINQ to SQL? I got stuck at the COUNT(c.ChildId), the generated SQL always seems to output COUNT(*). Hereās what I got so far:
from p in context.ParentTable join c inā¦
View On WordPress













