4 ms·
The thing you're missing is the way that LINQ creates an anonymous type, which is used to close over the values in the expression: var results = from a in
by louthy 10y ago
The thing you're missing is the way that LINQ creates an anonymous type, which is used to close over the values in the expression:
var results = from a in x
from b in y
from c in z
select a * b * c;
Is very much more attractive than:
var results = x.SelectMany(a => y.SelectMany(b => z.Select(c => a * b * c)));
If you use LINQ for more than just SQL queries (for monadic types like Option, Either, etc.) then these types of expression are commonplace. I'd certainly rather use C#'s LINQ grammar over its fluent API.