The orderby
clause of a LINQ query sorts the output sequence. You can control the properties used for sorting, and specify ascending or descending order.
This sample uses orderby
and descending
to sort a list of doubles from highest to lowest.
This sample uses orderby
to sort a list of products by units in stock from highest to lowest.
Next: Orderby then by » Previous: Ordering «