Skip to content
Rajasekar Su

Does ExecuteUpdateAsync bypass change tracking?

Applies to: EF Core 7+1 min read

Short answer

Yes. ExecuteUpdateAsync sends one UPDATE straight to the database. It never reads or updates the change tracker, so any entity you already loaded keeps its old values.

See it

Load an order, bulk-update the same row, then read the tracked instance:

var order = await db.Orders.FirstAsync(o => o.Id == 42);
// order.Status is "Pending", and EF is tracking it

await db.Orders
    .Where(o => o.Id == 42)
    .ExecuteUpdateAsync(s => s.SetProperty(o => o.Status, "Shipped"));

// The row in the database now says "Shipped"
Console.WriteLine(order.Status); // still "Pending"

Why it bites

The tracked entity still holds the value EF loaded. Change that property on it and call SaveChanges, and EF compares against the loaded value, not the database. Your bulk update gets overwritten with no warning.

It also skips concurrency checks. EF does not add your concurrency token to the UPDATE, so you add that condition to the Where clause yourself.

What I do

await db.Entry(order).ReloadAsync();
// order.Status is now "Shipped"

Sources