Range Cartesian Join in CSharp
Description
The following code shows how to range Cartesian Join.
Example
/*from w w w . jav a 2s . com*/
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);
}
}
}
The code above generates the following result.