var v = from a in numA
from b in numB
where a < b
select new { a = a,b = b};
private void SelectMany()
{
List
List
var v = numA.Join(numB, a => true, b => true,
(a, b) => new { a= a, b=b }).Where(c=>c.a < c.b );
foreach (var v1 in v)
{
Console.WriteLine("{0}",v1 );
}
}
OUTPUT
{ a = 12, b = 22 }
{ a = 12, b = 15 }
{ a = 12, b = 16 }
{ a = 12, b = 27 }
{ a = 25, b = 27 }
{ a = 5, b = 11 }
{ a = 5, b = 22 }
{ a = 5, b = 15 }
{ a = 5, b = 16 }
{ a = 5, b = 27 }
{ a = 6, b = 11 }
{ a = 6, b = 22 }
{ a = 6, b = 15 }
{ a = 6, b = 16 }
{ a = 6, b = 27 }
{ a = 7, b = 11 }
{ a = 7, b = 22 }
{ a = 7, b = 15 }
{ a = 7, b = 16 }
{ a = 7, b = 27 }
No comments:
Post a Comment