blob: a4c96ad74b4e7fb6d3d10dc46c43e86ccaa5b599 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
using System;
using System.Linq;
class NestedQuery
{
public void XX ()
{
var enumerable = new string[] { "aba", "bbb", "bab", "aaa" }.
Select((values) => new { values = values, length = values.Length }).
Select((ti0) => ti0.values.Select ((type) => new { type = type, x = 9 }).Where((ti1) => (ti0.length == 3)).
Select((ti1) => ti1.type));
}
public static int Main ()
{
var e = from values in new [] { "aba", "bbb", "bab", "aaa" }
where values.Length > 0
select from type in values
where type == 'a'
select type;
int counter = 0;
foreach (var v in e)
foreach (var vv in v) {
++counter;
Console.WriteLine (vv);
}
if (counter != 6)
return 1;
e = from values in new [] { "aba", "bbb", "bab", "aaa" }
let length = values.Length
select from type in values
let x = 9
where length == 3
select type;
counter = 0;
foreach (var v in e)
foreach (var vv in v) {
++counter;
Console.WriteLine (vv);
}
if (counter != 12)
return 2;
return 0;
}
}
|