Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Latest commit

 

History

History
28 lines (16 loc) · 1.15 KB

orderings-3.md

File metadata and controls

28 lines (16 loc) · 1.15 KB

LINQ - Ordering Operators

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.

orderby multiple properties

This sample uses a compound orderby to sort a list of digits, first by length of their name, and then alphabetically by the name itself.

Multiple ordering descending

This sample uses a compound orderby to sort a list of products, first by category, and then by unit price, from highest to lowest.

Reverse the sequence

This sample uses Reverse to create a list of all digits in the array whose second letter is 'i' that is reversed from the order in the original array.

Next: Custom comparisons » Previous: Ordering descending «

Home