In LINQ, quantifier operators are used to returning a boolean value which shows that whether some or all elements satisfies the given condition. The Standard Query Operator supports 3 different types of quantifier operators:
The All operator is used to check each and every element in the sequence if all the elements satisfy the given condition then it will return true. Otherwise, return false. For example, we have a sequence, i.e, aa, aa, aa, aa. To check if all the elements of the sequence are “aa” we use All operator, this operator checks each and every element present in the given sequence and return true because all the elements present in the given sequence satisfy the given condition.
- It does not support query syntax in C# and VB.Net languages.
- It support method syntax in both C# and VB.Net languages.
- It present in both the Queryable and Enumerable class.
- It will throw ArgumentNullException if the given source or the given condition is null.
- It does not return value instead of this it return true or false.
- The return type of this operator is System.Boolean.
Is the given sequence contain all element as 77 : False Is the given sequence contain all element as 'aa' : True
Is all the employees are female?: False
- LINQ | Quantifier Operator | Any
- LINQ | Quantifier Operator | Contains
- LINQ | Set Operator | Except
- LINQ | Element Operator | First
- LINQ | Partition Operator | Take
- LINQ | Filtering Operator | where
- LINQ | Set Operator | Intersect
- LINQ | Set Operator | Union
- LINQ | Set Operator | Distinct
- LINQ | Element Operator | Last
- LINQ | Element Operator | ElementAt
- LINQ | Element Operator | SingleOrDefault
- LINQ | Element Operator | ElementAtOrDefault
- LINQ | Element Operator | Single
- LINQ | Sorting Operator | Reverse
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.