Mid LINQ

Sum salary by department, only if salary > 70k?

Sum salary by department, only if salary > 70k

Follow :

var sum = employees

.Where(e => e.Salary > 70000)

.GroupBy(e => e.Department)

.Select(g => new { g.Key, Sum = g.Sum(e => e.Salary) });

More from LINQ Tutorial

All questions for this course