Force parameter evaluation for anonymous function
<p>I wonder if there's easy way to force parameter evaluation for anonymous function? It is significant </p>

<p>for multithread programming. 
For example when i wrote</p>

<pre><code>        for(int i=0; i&lt;5; ++i)
        {
            Task.Factory.StartNew(() =&gt; Console.WriteLine(i));
        }
</code></pre>

<p>Most people would get "5" five times. In fact the code snip is more likely expected to ouput 0 to 5.</p>

<p>One quick solution is following:</p>

<pre><code>        for(int i=0; i&lt;5; ++i)
        {
            var local = i;
            Task.Factory.StartNew(() =&gt; Console.WriteLine(local));
        }
</code></pre>

<p>I think life is better if following method existed to evaluate all parameters for anonymous function and return one as same logic as the origin:</p>

<pre><code>    Action EvaluateParameters(Action action)
</code></pre>

<p>Any ideas?</p>

<p>Thanks.</p>
