Mid LINQ

How to use LINQ to check if all employees belong to a?

How to use LINQ to check if all employees belong to a

department?

Follow :

bool allInIT = employees.All(e => e.Department == "IT");

Console.WriteLine(allInIT ? "All employees are in IT" : "Not all

employees are in IT");

More from LINQ Tutorial

All questions for this course