Mid LINQ

Find the department with the most employees?

Find the department with the most employees

var mostPopulated = employees

.GroupBy(e => e.Department)

.OrderByDescending(g => g.Count())

.FirstOrDefault();

More from LINQ Tutorial

All questions for this course