title: Possible to modify a List while iterating through it?
body: <p>I have the following:</p>
  <pre><code>foreach (var depthCard in depthCards)
  {
      var card = InternalGetCard(db, depthCard.CardId);
      var set = InternalGetSet(db, (int)card.ParentSetId);
      var depthArray = InternalGetDepthArrayForCard(db, set.SetId);
      foreach (var cardToUpdate in set.Cards)
      {
          // do stuff
          SaveChanges(db);
          // since I already took care of it here, remove from depthCards
          depthCards.Remove(depthCardToUpdate);
      }
  }
  </code></pre>
  <p>This isn't working though because I'm modifying the collection in the middle of a loop. Is there some type of collection that does allow this type of access?</p>
  <p>I don't want to <code>ToList()</code> the <code>depthCards</code> because I already have them and I <em>want</em> to modify that list as I'm iterating. Is this possible?</p>