title: List<T>.ForEach with index
body: <p>I'm trying to find the LINQ equivalent of the following code:</p>
  
  <pre><code>NameValueCollection nvc = new NameValueCollection();
  
  List&lt;BusinessLogic.Donation&gt; donations = new List&lt;BusinessLogic.Donation&gt;();
  donations.Add(new BusinessLogic.Donation(0, "", "", "");
  donations.Add(new BusinessLogic.Donation(0, "", "", "");
  donations.Add(new BusinessLogic.Donation(0, "", "", "");
  
  for(var i = 0; i &lt; donations.Count(); i++)
  {
      // NOTE: item_number_ + i - I need to be able to do this
      nvc.Add("item_number_" + i, donations[i].AccountName);
  }
  </code></pre>
  
  <p>I was hoping I could use something like:</p>
  
  <pre><code>NameValueCollection nvc = new NameValueCollection();
  
  List&lt;BusinessLogic.Donation&gt; donations = new List&lt;BusinessLogic.Donation&gt;();
  donations.Add(new BusinessLogic.Donation(0, "", "", "");
  donations.Add(new BusinessLogic.Donation(0, "", "", "");
  donations.Add(new BusinessLogic.Donation(0, "", "", "");
  
  donations.ForEach(x =&gt; nvc.Add("item_name_" + ??, x.AccountName);
  </code></pre>
  
  <p>But I've not found a way to determine which iteration the loop is on. Any help would be appreciated!</p>