Re: misunderstanding between standard query operator & differed query execution
Select (or select) does not perform the enumeration operation. In the samples you give, ForEach is the operator performing the enumeration operation.
I sample 2, select is here just because it is required in a C# query expression. You'll note that it's not the case in VB...
The select operator is actually useful only when we use something like select book.Title or select book.Price / 2.
Select is part of the query definition but does not execute the query. Iteration happens only with foreach, ForEach, ToArray, ToList and the likes.
|