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();
Find the department with the most employees
var mostPopulated = employees
.GroupBy(e => e.Department)
.OrderByDescending(g => g.Count())
.FirstOrDefault();