how to construct a list using Linq, while doing something else?
<p>for example</p>

<pre><code>          foreach (var item in List&lt;int&gt; a)
           {
            b.add(item);
            c+=item;
            dosomething();
           }
</code></pre>

<p>how to write this into Linq form? or is it necessary?</p>

<p>I guess it has the following format: <code>var b = a.xxxx(x=&gt;(c+=x;dosomething())).ToList()</code></p>
