tags:

views:

150

answers:

1

I know

from f in list 
where f.bar == someVar
select f

can be written as

list.Where( f => f.bar == someVar );

Can a similar expression be created from

from f in foo
from b in f.bar
where b.something == someVar
select b;

?

+5  A: 

from maps (for subsequent terms) to SelectMany:

var query = foo.SelectMany(f=>f.bar).Where(b=>b.something==someVar);

(note that no final Select is necessary for trivial projections)

Marc Gravell
too quick for me :)
Nathan W
Dude. You can't possibly be human. You must be some kind of Android :-)
Jose Basilio
@Jose: [whirr] Does not compute. Repeat query from start.
Marc Gravell