public void Update(TestHarness harness, bool autoDetectChanges) { using (var context = new OrdersContext(_connectionString)) { var customers = GetAllCustomersFromDatabase(); Assert.Equal(1000, customers.Length); context.Configuration.AutoDetectChangesEnabled = autoDetectChanges; using (harness.StartCollection()) { foreach (var customer in customers) { context.Entry(customer).State = EntityState.Modified; } } } }