What do you want to save?
Add Code snippet
New code examples
-
C# 2021-10-09 15:02:03
linq left join group by
from p in context.ParentTable join c in context.ChildTable on p.ParentId equals c.ChildParentId into j1 from j2 in j1.DefaultIfEmpty() group j2 by p.ParentId into grouped select new { ParentId = grouped.Key, Count = grouped.Count(t=>t.ChildId != null) } Add solution