LINQ

LINQ = Language Integrated Query
using System; using System.Linq;
using System.Collections.Generic;
public class bar { public static void Main () {
Func<int,bool> odd = ( x => (x & 1) == 1 );
var result = 
    from x in new int [] { 1,2,3 }
    from y in new int [] { 4,5,6 }
    where odd (x+y)
    select x*y;
foreach (var r in result) 
  { System.Console.WriteLine (r); } } }



Johannes Waldmann 2011-01-18