-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWhereTest.linq
More file actions
43 lines (31 loc) · 746 Bytes
/
WhereTest.linq
File metadata and controls
43 lines (31 loc) · 746 Bytes
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
<Query Kind="Program" />
void Main()
{
Foo.allFoo().Dump();
Foo.someFoo().Count().Dump();
}
// Define other methods and classes here
public class Foo {
public Foo(string name, int age, bool active = false) {
Name = name;
Age = age;
Active = active;
}
public string Name { get; set; }
public int Age {get;set;}
public bool Active {get;set;}
public static IEnumerable<Foo> allFoo() {
return new List<Foo>(){
new Foo("Scooby", 22),
new Foo("Daphne", 24, true),
new Foo("Shagge", 25),
new Foo("Velma", 37, true),
new Foo("Fred", 41),
new Foo("John", 44, true)
};
}
public static IEnumerable<Foo> someFoo() {
var some = allFoo().Where(f => f.Active);
return some.Where(f => f.Age > 30);
}
}