In class/Microsoft.Build.Tasks:
[mcs.git] / tests / gtest-linq-18.cs
blobdee1013737e5f1720e9586e053fe880dcfd1c312
1 using System;
2 using System.Linq;
4 // LINQ and lambdas mix tests
6 public class C
8 static bool Test (Func<int, bool> f)
10 return false;
13 static bool Test2 (Func<int, int> f)
15 return false;
18 static int Main ()
20 var x = new int [] { 'a', 'b', 'c' };
22 var e = from ck in x
23 let xy = Test(c => c == ck)
24 where ck == 'v'
25 select Test(c => c == ck);
27 var e2 = from ck in x
28 where Test(c => c == ck)
29 select Test(c => c == ck);
31 int[] int_array = new int [] { 0, 1, 2, 3, 4 };
32 var e3 = from int i in int_array group Test2 (gg => i + 2) by Test2 (g => i % 2);
34 var e4 = from i in x
35 let l = i + 4
36 let g = l - 2
37 where Test(c => c == l)
38 where l > 0
39 select l;
41 var e5 = from a in x
42 join b in x on Test (a2 => a2 == a) equals Test (b2 => b2 == b)
43 select a;
45 var e6 = from a in x
46 join b in x on Test (a2 => a2 == a) equals Test (b2 => b2 == b) into re6
47 select a;
49 return 0;