Mid LINQ

Replace empty departments with “Unassigned”?

Replace empty departments with “Unassigned”

var updated = employees.Select(e => new {

e.Name,

Department = string.IsNullOrEmpty(e.Department) ? "Unassigned" :

e.Department

});

More from LINQ Tutorial

All questions for this course