1.The query is executed when the query variable is iterated over in the foreach statement.
2.With deferred query execution, the query variable does not hold the query results—it only stores the query command.
3.The query is actually executed at some point after the construction of the query.
4.It always gives you the latest data.
Immediate Query Execution :
1.In contrast to the deferred execution of queries that produce a sequence of values, queries that return a singleton value are executed immediately.
E.g. of singleton queries areAverage, Count, First, and Max.
2.To force the immediate execution of a query that does not produce a singleton value, you can call the ToList method or ToArray method.
0 Comments