May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Ordering operators allow sorting query results according to the given condition. Within LINQ queries this is accomplished via the Order By clause. This clause allows ordering query results in both ascending and descending fashions, where ascending is the default way. The following example sorts the query result so that products are ordered from the one that has the lowest unit price to the one having the highest unit price:
![]()
To get a result ordered from the highest value to the lowest, you use the Descending keyword as follows:
This can shape the query result opposite of the first example. You can also provide more than one ...
Read now
Unlock full access