First ThenBy Prototype : ThenBy « LINQ « C# / CSharp Tutorial






using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public class MainClass {
    public static void Main() {

        string[] presidents = {"ant", "arding", "arrison", "eyes", "over", "Jackson"};

        IEnumerable<string> items = presidents.OrderBy(s => s.Length).ThenBy(s => s);

        foreach (string item in items)
            Console.WriteLine(item);
    }
}








22.73.ThenBy
22.73.1.Using an OrderBy and a ThenBy clause with a custom comparer to sort first by word length and then by a case-insensitive descending sort of the words in an array.
22.73.2.First ThenBy Prototype
22.73.3.OrderByDescending and ThenBy