title: How best to remove list items in a loop in C#
body: <p>Given the code:</p>
  
  <pre><code>var AllItems = new List&lt;CartItem&gt;();
  
  using(var db = new MainContext())
  {
      foreach (var item in AllItems)
      {
          if (!db.tblStoreItems.Where(i =&gt; i.ID == item.ItemID).Any())
          {
              AllItems.Remove(item);
          }
      }
  }
  </code></pre>
  
  <p>Is this the best way to remove an item from the List object in a loop?</p>