void Main()
{
List<SomeContainer> someList = new List<SomeContainer>();
someList.Add(new SomeContainer { a = true, b = true, c = true });
someList.Add(new SomeContainer { a = false, b = true, c = false });
someList.Add(new SomeContainer { a = true, b = true, c = false });
someList.Add(new SomeContainer { a = true, b = false, c = false });
someList.Add(new SomeContainer { a = true, b = false, c = false });
someList.Add(new SomeContainer { a = true, b = true, c = false });
someList.Add(new SomeContainer { a = true, b = true, c = false });
var q1 = from container in someList where container.a == true select container.a;
var q2 = from container in someList where container.b == true select container.b;
var q3 = from container in someList where container.c == true select container.c;
q1.Count().Dump();
q2.Count().Dump();
q3.Count().Dump();
}
class SomeContainer
{
public Boolean a { get; set; }
public Boolean b { get; set; }
public Boolean c { get; set; }
}
is it possible to generate something like this with one querry:
a | b | c
6 | 5 | 1