If you've been coding with .NET for awhile then you've most likely encountered a method that returns IEnumerable<T>. If you're like me, you realize that this returns a list of items your can loop through and evaluate. If you ever dug into the code you may have found a funny looking return statement yield return.

Now, the first time I came across this I was shocked - I know I assigned my results -- what happened?

As it turns out, there is this little thing called lazy evaluation in play here - Unless we need it, the method doesn't get called. And since we aren't using our results anywhere, the method is never actually executed.

Lazy Yet Eager

So we've determined that unless we use the results of our method, the method won't ever be executed, which on one hand is actually really quite a handy feature.

Now here is another question for you, when we do use our results -- what happens then? Consider this little bit of code.