Ooops, my original code is correct, but I typed this in the post:

 

ParentColl.SelectMany(p => p.ChildColl).Where(c => c.Type == "Foo");

 

I meant:

 

ParentColl.SelectMany(p => p.ChildColl.Where(c => c.Type == "Foo"));

 

They produce the same result. The first would select all children before
filtering. The second would filter then select. Whether there is any actual
implementation difference I dunno, but I prefer the second.

 

Greg

Reply via email to