METHOD

Enumerable.ThenBy

Adds an ascending secondary key to an existing ordered sequence.

Formal Syntax & Structure

csharp syntaxcsharp
orderedSource.ThenBy(keySelector)

Working Example

Example Snippetcsharp
using System;using System.Linq;var sorted = new[] {"b","aa","a"}.OrderBy(s => s.Length).ThenBy(s => s, StringComparer.Ordinal);
C# & .NET Reference