Mid LINQ

How to check if a collection is empty with LINQ?

How to check if a collection is empty with LINQ?

bool hasEmployees = employees.Any();

Console.WriteLine(hasEmployees ? "There are employees" : "No

employees");

More from LINQ Tutorial

All questions for this course