Mid From PDF LINQ LINQ

Show all departments even if no employees (outer join)?

Show all departments even if no employees (outer join)

var allDepts = from d in departments

join e in employees on d.Name equals e.Department

into empGroup

from eg in empGroup.DefaultIfEmpty()

select new {

Dept = d.Name,

EmpName = eg?.Name ?? "No Employee"

More from LINQ Tutorial

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details