How to use OrderBy, OrderByDescending, ThenBy, ThenByDescending, and Reverse on sorting technique in LINQ.
How to use OrderBy, OrderByDescending, ThenBy, ThenByDescending, and Reverse on sorting technique in LINQ.
Student
An enthusiastic, adaptive, and fast-learning person with a broad and acute interest in the discovery of new innovative drugs, I particularly enjoy collaborating with scientists from different disciplines to develop new skills and solve new challenges.
In LINQ, the sorting operators are used to sort data in ascending or descending order based on one or more attributes in Collection or SQL Server database.
There are following are the different types of sorting operators.
orderby and orderby ... descending
Syntax
Example
Output:
thenby and theneby... descending
Syntax
Example
Output
Reverse
Output