Hooked on LINQ

Hooked on LINQ - Developers' Wiki
for .NET Language Integrated Query

Quick Search

Advanced Search »

ThenByDescending Operator

Modified: 2007/01/24 02:59 by t_magennis - Categorized as: LINQ to Objects
{TOC}
Namespace:System.Linq
Assembly:System.Core.dll
Extends:IEnumerable<T>

Back to Standard Query Operator Index


Edit

Introduction

The ThenByDescending operator orders an ordered sequence according to one or more keys in descending order.

Edit

Method Signatures

// 1 - Sub-order an ordered sequence.
public static IOrderedSequence<TSource> ThenByDescending<TSource, TKey>(
    this IOrderedSequence<TSource> source, 
    Func<TSource, TKey> keySelector)
 
// 2 - Sub-order an ordered sequence, using a custom comparer.
public static IOrderedSequence<TSource> ThenByDescending<TSource, TKey>(
    this IOrderedSequence<TSource> source, 
    Func<TSource, TKey> keySelector, 
    IComparer<TKey> comparer)



Edit

Exceptions

Throws an ArgumentNullException if source is null.


Edit

Pseudo-code

See OrderByDescending Operator. ThenBy sub sorts the sorted sequence.

Edit

Loop count

See OrderByDescending.

Edit

Code Samples

TODO: Needs code sample.

If you would like to comment on this page, click on the Discuss button located on the top-right of each page. Feel free to edit any mistakes or ommissions you find. If you have an objection or find in-appropriate content then contact the administrator. This website is not affiliated with Microsoft®, all content and opinions are those of the specific author and some advice, solutions and article may contain un-intentional errors - please use care. Powered by ScrewTurn Wiki version 2.0.33. Some of the icons created by FamFamFam.