title: How do I delete multiple rows in Entity Framework Core?
body: <p>I need to delete multiple rows from a database using Entity Framework Core.</p>
  
  <p>This code does NOT work:</p>
  
  <pre><code>foreach (var item in items)
  {
      myCollection.Remove(item);
  }
  </code></pre>
  
  <p>because I get an error "InvalidOperationException: Collection was modified; enumeration operation may not execute" after the first object. In other words, <strong>.Remove</strong> removes only one object.</p>
  
  <p>Entity Framework Core does NOT have <strong>.RemoveRange</strong>, so I have no idea how to perform this operation.</p>
  
  <p>In order to preserve maximum compatibility with the various database providers, I would prefer NOT to call context.Database.ExecuteSqlCommand("delete from physical_table where..."). Is there a suitable solution? Thanks!</p>