Advertisement

Deferred Vs Immediate Query Execution in LINQ

Deferred Vs Immediate Query Execution in LINQ Deferred Query Execution :
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.

LINQ in .Net,Language Integrated Query in .Net,Basics of LINQ,Introduction to LINQ,What is LINQ,Learn LINQ Step by Step,LINQ Query Syntax,LINQ Method Syntax,LINQ Standard Query Operators,LINQ Query Execution,LINQ Deferred Query Execution,LINQ Immediate Query Execution,

Post a Comment

0 Comments