int[] intArray = { 8, 10, 2, 6, 3 };
Array.Sort(intArray);
foreach (var i in intArray)
{
Console.WriteLine(i);
}
foreach (var i in intArray.Reverse())
{
Console.WriteLine(i);
}
order objects by property:
MyCollection.OrderBy(o => o.PropertyName);
MyCollection.OrderByDescending(o => o.PropertyName);