Articles
FAQs
Login
LINQ Any Operator
By Peter Bromberg
Access over 40 UI widgets with everything from interactive menus to rich charts.
The Any operator checks whether any element of a sequence satisfies a condition. The Any operator enumerates the source sequence and returns true if any element satisfies the test given by the predicate. If no predicate function is specified, the Any operator simply returns true if the source sequence contains any elements.
bool b = products.Any(p => p.UnitPrice >= 100 && p.UnitsInStock == 0);
LINQ Any Operator
(
474 Views
)