Try to understand what is happening under the hood:
- How are query expressions translated by the compiler
- How LINQ to Objects passes its data and how it cancels execution.
- How queries are executed remotely through IQueryable trees and expressions
It is also useful to arrange both query expressions, for example
var query = from person in people
where person.IsAdult
select person.Name;
and "dot notation":
var query = people.Where(person => person.IsAdult)
.Select(person => person.Name);
Knowing both will allow you to choose the most readable form for any particular request.
source
share