How can I write this LINQ query by using the extension method syntax?
var query = from a in sequenceA
from b in sequenceB
select ...;
var query = sequenceA.SelectMany(a => sequenceB.Select(b => ...));
Edit: as pointed out by Eric Lippert in the comments, this gives the same results, but is intentionally not how it is translated internally. See his answer for another way to call SelectMany
, which does correspond to the original. Also, added the omitted b =>
for clarity.