The Geek in Pink

LINQ Deferred Execution

This is more of an FYI for myself, but just in case you didn’t know…

LINQ queries are not executed when they are defined or when they are modified by calling a method such as Where or OrderBy. Instead, query execution is deferred, which means that the evaluation of an expression is delayed until its realized value is actually iterated over or the ToList method is called.

Source: http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part6-cs

Tagging: ,

Leave a reply