Learn to specify either eager or lazy query execution.
The following sample shows how query execution is deferred until the query is enumerated at a foreach statement.
The following sample shows how queries can be executed immediately with operators such as ToList()
.
You can replace the ToList
call with a ToArray
. Try it.
The following sample shows how, because of deferred execution, queries can be used again after data changes and will then operate on the new data.
Next: Join operators » Previous: sequence-operations »