title: How can I refactor this ForEach(..) code to use Parallel.ForEach(..)?
body: <p>i've got a list of objects which I wish to copy from one source to another. <a href="https://stackoverflow.com/questions/5702800/how-to-move-a-lot-of-items-from-one-s3-amazon-bucket-to-another">It was suggested that I could speed things up</a> by using <a href="http://msdn.microsoft.com/en-us/library/system.threading.tasks.parallel.foreach.aspx" rel="nofollow noreferrer">Parallel.ForEach</a> </p>
  
  <p>How can I refactor the following pseduo code to leverage <code>Parallel.ForEach(..)</code> ?</p>
  
  <pre><code>var foos = GetFoos().ToList();
  foreach(var foo in foos)
  {
      CopyObjectFromOldBucketToNewBucket(foo, oldBucket, newBucket, 
          accessKeyId, secretAccessKey);
  }
  </code></pre>
  
  <p><code>CopyObjectFromOldBucketToNewBucket</code> uses the Amazon REST APIs to move items from one bucket to another.</p>
  
  <p>Cheers :)</p>