A query expression in C# is, as you probably know, just a syntactic sugar for a bunch of method calls. For example,
from customer in customers where customer.City == "London" select customer.LastName
is a syntactic sugar for
customers. Where(customer => customer.City == "London"). Select(customer => customer.LastName)
A great many queries are straightforward variations on this pattern: the query is translated into a series of method calls where the arguments are lambdas formed from the range variables and expressions in the query. However, some of them are weird. This one is straightforward: Continue reading