Any operator
The LINQ operator that answers whether at least one item matches, stopping at the first one that does.
In more detail
With no predicate it simply asks whether the sequence has any items at all. Use Any() rather than comparing Count() with zero, which would count every item.
Related terms
- LINQ — Language Integrated Query: a set of C# operators such as Where, Select and OrderBy for filtering, shaping and combining sequences of data.
Taught in
- Collections, Generics, and LINQ — Modern .NET Core, C# & Enterprise Microservices