There’s no need for LINQ here, just call Sort
:
list.Sort();
Example code:
List<int> list = new List<int> { 5, 7, 3 };
list.Sort();
foreach (int x in list)
{
Console.WriteLine(x);
}
Result:
3
5
7
More Related Contents:
- How to split Fromdate and Todate based on weekdays(Sat,Sun) using linq c#
- IEnumerable vs List – What to Use? How do they work?
- Flatten List in LINQ
- Using LINQ to remove elements from a List
- Check whether an array is a subset of another
- Quickest way to compare two generic lists for differences
- How can I get every nth item from a List?
- Combination of List
- Select distinct using linq [duplicate]
- Linq select objects in list where exists IN (A,B,C)
- Differences between IQueryable, List, IEnumerator?
- How to get the closest number from a List with LINQ?
- Find the most occurring number in a List
- Does Distinct() method keep original ordering of sequence intact?
- how to check if object already exists in a list
- Conversion from List to array T[]
- LINQ to find series of consecutive numbers
- C#: How to convert a list of objects to a list of a single property of that object?
- Easiest way to Rotate a List in c#
- Count property vs Count() method?
- How to find List has duplicate values in List [duplicate]
- Get a list of distinct values in List
- Using Linq Except not Working as I Thought
- How to Quickly Remove Items From a List
- List.Except is not working
- Remove duplicate items from list in C#, according to one of their properties
- Sort one list by another
- Compare Two Lists Via One Property Using LINQ
- Return max repeated item in list
- What is the best way to check two List lists for equality in C#