May 2010
Intermediate to advanced
1272 pages
61h 18m
English
When the CLR encounters a LINQ query, the query is not executed immediately. LINQ queries are executed only when they are effectively used. This concept is known as deferred execution and is part of all LINQ providers that you encounter, both standard and custom ones. For example, consider the query that is an example in the previous discussion:

This query is not executed until you effectively use its result. If the query is defined within a function and is the result of the method, the Return instruction causes the query to be executed:
Iterating the result also causes the query to be executed:
Another example ...
Read now
Unlock full access