title: Is There A More Efficient Way To Code This Entity Framework Core UpdateRange Code?
body: <pre><code>var results = context.Customer.Where(c =&gt; c.CustomerId == customerId).AsQueryable();
  
  foreach(Customer cust in results)
  {
      cust.isDeleted = true;
  }
  
  context.UpdateRange(results);
  context.SaveChanges();
  </code></pre>
  <p>** Using the loop seems inefficient. Can the fetch and update be done in a single statement?</p>