Range Cartesian Join : Range « LINQ « C# / CSharp Tutorial






using System;
using System.ComponentModel;
using System.Linq;

    class MainClass
    {
        static void Main()
        {
            var query = from left in Enumerable.Range(1, 4)
                        from right in Enumerable.Range(11, left)
                        select new { Left = left, Right = right };

            foreach (var pair in query)
            {
                Console.WriteLine("Left={0}; Right={1}", pair.Left, pair.Right);
            }
        }
    }








22.59.Range
22.59.1.Range Cartesian Join
22.59.2.Range Enumeration
22.59.3.Range Filtering
22.59.4.Range Ordering
22.59.5.Range Projection
22.59.6.Range Reversal