An untidy nested query : Nested Query « LINQ « C# / CSharp Tutorial






using System;
using System.Collections.Generic;
using System.Linq;
public class MainClass {
    public static void Main() {
        string[] names = { "Tom", "Dick", "Harry", "Mary", "Jay" };

        IEnumerable<string> query =
          Enumerable.Select(
            Enumerable.OrderBy(
              Enumerable.Where(
                names, n => n.Contains("a")
              ), n => n.Length
            ), n => n.ToUpper()
          );
    }
}








22.5.Nested Query
22.5.1.Nested query list
22.5.2.An untidy nested query