deferred vs immediate query execution
Deferred Query execution
Deferred Query execution means the query variable holds the query command and the execution of the query can be delayed. When the foreach statement is used, the query is executed. The Deferred Query execution is mostly used in situations where data is updated continously. Many a times, deferred queries are preferred over immediate queries.
Immediate Query execution
Immediate Query execution means the query will be executed immediately. For example , when we use aggregation operators like SUM, Average and Count etc, the query will be operated on all the data before it outputs the result. The ToList() and ToArray() methods also cause the immediate query execution.