title: Delete inside foreach with linq where
body: <p>I can see why this is not allowed:</p>
  
  <pre><code>foreach (Thing t in myCollection) {
     if (shouldDelete(t) {
        myCollection.Delete(t);
     }
  }
  </code></pre>
  
  <p>but how about this?</p>
  
  <pre><code>foreach (Thing t in myCollection.Where(o=&gt;shouldDelete(o)) {
     myCollection.Delete(t);
  }
  </code></pre>
  
  <p>I don't understand why this fails. The "Where()" method obviously isn't returning the original collection, so I am not enumerating round the original collection when I try to remove something from it.</p>