Hooked on LINQ

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

Companion book for this site
LINQ to Objects Using C# 4.0:
Using and Extending LINQ to Objects and Parallel LINQ (PLINQ)
Quick Search

Advanced Search »

ThenBy Operator

Modified: 2007/01/23 23:56 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 ThenBy operator orders an ordered sequence according to one or more keys in ascending order.

Edit

Method Signatures

// 1 - Order an already ordered sequence in ascending order by one or more keys. public static IOrderedSequence ThenBy(IOrderedSequence source, Func keySelector)

// 2 - Order an already ordered sequence in ascending order by one or more keys. // A custom comparer function can be provided. public static IOrderedSequence ThenBy(IOrderedSequence source, Func keySelector, IComparer comparer)

Edit

Exceptions

Throws an ArgumentNullException if source is null.


Edit

Pseudo-code

See OrderBy Operator. ThenBy sub sorts the sorted sequence.

Edit

Loop count

See OrderBy.

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 omissions 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 unintentional errors - please use care. Other websites by this author: Focused Objective, Geek Speak Decoded.