411 REFERENCE · Wikibooks
C Sharp Programming/Keywords/orderby
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Keywords orderby
__TOC__
The orderby contextual keyword is used to define the sort order of query results. Specifying orderby key1 ascending sorts from the smallest first to the largest at the end, while orderby key2 descending sorts from the largest first to the smallest at the end. The default sort order is ascending and if neither direction is specified, results will be sorted in ascending order. Multiple keys may be used to sort, with the first one specified being the primary sort and later entries providing secondary sorts when the first key matches, e.g., orderby lastName ascending, firstname ascending.