How does the following LINQ statement work?
Here is my code:
var list = new List{1,2,4,5,6}; var even = list.Where(m => m%2 == 0); list.Add
The reason for this is the deferred execution of your lambda expression. The query gets executed when you start iterating in the foreach loop.