Thursday, June 2, 2011

LINQ and "Access to Modified Closure" problem

I used to be a middle level user of LINQ and recently started to use it extensively. While i was writing some LINQ, one resharper comment really puzzled me " Access to Modified Closure". I googled for this and finally got this URL. Very informative. This problem is enough to make developer MAD, since this is not easily identifiable from Debugging.

http://blogs.msdn.com/b/ericlippert/archive/2009/11/12/closing-over-the-loop-variable-considered-harmful.aspx

1 comment: