Lambdas & LINQ in C# – Bonus: Captured Variables & for Loops
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 […]