Mid LINQ

Count distinct departments?

Count distinct departments

var deptCount = employees

.Select(e => e.Department)

.Distinct()

.Count();

More from LINQ Tutorial

All questions for this course