title: Delete a big list of items with Entity Framework
body: <p>I want to delete a big list of items with EF, so I tried to remove them one by one but it take long time.</p>
  
  <p>And I tried to use <code>.RemoveAll()</code> method with my list but it don't update the database [only remove from loaded entity]</p>
  
  <p>So I use a <code>SqlCommand</code> to remove them from the database and I use <code>.RemoveAll()</code> to prevent EF <code>unexpected number of rows update (0)</code> exception.</p>
  
  <p>Code:</p>
  
  <pre><code>dbContext.Database.ExecuteSqlCommand("DELETE FROM xxx WHERE xxx");
  loadedEntity.subItems.ToList().RemoveAll(r =&gt; true);
  dbContext.SaveChanges();
  </code></pre>
  
  <p>My question: is there a better way to do this?</p>