In LINQ, sorting operators are used to rearrange the given sequence in ascending or descending order based on one or more attributes. There are 5 different types of sorting operators are available in LINQ:
The reverse operator is used to reverse the order of the sequence or collection. Unlike the OrderBy Method, it does not consider the actual value in itself in determining the order, instead of this, it returns the items in the reverse order in which they actually present.
For example, the collection is present in ascending order when you use the Reverse Method on the given collection it reverses the order of the collection, i.e, in descending order.
- 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 is implemented by using deferred execution.
The Sequence is: 1 2 3 4 5 6 7 New Sequence: 7 6 5 4 3 2 1
Employee Name: Supriya Employee Name: Soniya Employee Name: Rohit Employee Name: Anju Employee Name: Anjita Employee Name: Anil
- LINQ | Sorting Operator | OrderBy
- LINQ | Sorting Operator | ThenByDescending
- LINQ | Sorting Operator | ThenBy
- LINQ | Sorting Operator | OrderByDescending
- LINQ | Set Operator | Except
- LINQ | Quantifier Operator | All
- LINQ | Set Operator | Distinct
- LINQ | Quantifier Operator | Contains
- LINQ | Quantifier Operator | Any
- LINQ | Partition Operator | Take
- LINQ | Element Operator | First
- LINQ | Element Operator | Last
- LINQ | Set Operator | Union
- LINQ | Filtering Operator | where
- LINQ | Set Operator | Intersect
- LINQ | Partition Operator | TakeWhile
- LINQ | Concatenation Operator | Concat
- LINQ | Grouping Operator | GroupBy
- LINQ | Grouping Operator | ToLooKUp
- LINQ | Equality Operator | SequenceEqual
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.