List<MyParentClass> parents = new List<MyParentClass>();
var parent1 = new MyParentClass("parent1");
var parent2 = new MyParentClass("parent2");
parents.Add(parent1);
parents.Add(parent2);
var child1 = new MyChildClass("child1");
parent1.children.Add(child1);
var child2 = new MyChildClass("child2");
var child3 = new MyChildClass("child3");
parent2.children.Add(child2);
parent2.children.Add(child3);
var foo = from p in parents
select from c in p.children
select c;
Assert.IsNotNull(foo);
Assert.AreEqual(3, foo.Count());
NUnit.Framework.AssertionException:
expected: <3>
but was: <2>
I think I'm getting an IList of ILists back, but I exepect just the three children. How do I get that?