Lambdas & LINQ in C# – Bonus: Captured Variables & for Loops

In this video

Lambda Expressions have a really cool feature called “captured variables”. This is very useful (as we saw in Part 1), but it can also be dangerous if we try to capture the indexer of a “for” loop. Today we’ll see the problem in action, and we’ll also look at a really easy solution. For code samples and more information, be sure to visit http://www.jeremybytes.com/Demos.aspx

(Visited 100 times, 1 visits today)

You might be interested in