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






using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

    class MainClass
    {
        static void Main()
        {
            var query = from first in Enumerable.Range(1, 5)
                        from second in Enumerable.Range(1, first)
                        select new { first, second };

            foreach (var item in query)
            {
                Console.WriteLine(item);
            }
        }
    }








22.8.Join
22.8.1.Join two object lists
22.8.2.Use join key word
22.8.3.Join three object list
22.8.4.Use Join on
22.8.5.Join Operator
22.8.6.Cartesian Join demo
22.8.7.Use == in join
22.8.8.Simple Join
22.8.9.OrderBy joined value
22.8.10.Join on substring