The compiler converts the first method into a second compilation process.
However, if you make a nontrivial query expression with a trivial sentence select, the call selectwill not be deleted.
Therefore, each of the following pairs of expressions will be combined in the same way:
from x in Enumerable.Range(0,1000) where x / 2 == x / 2.0 select x
Enumerable.Range(0,1000).Where(x => x / 2 == x / 2.0)
from x in Enumerable.Range(0,1000) select x
Enumerable.Range(0,1000).Select(x => x)
SLaks source
share