Entry state modified even if no property was modified (DbUpdateConcurrencyException)
Posted: Mon 27 Apr 2020 12:58
If I set a property of an entity Album, let’s say Album.Name = "Greatest Hits", but Album.Name == "Greatest Hits" was true before, DbContext.Entry<Album>(Album).State is set to EntityState.Modified. This seems to be wrong, because there is no change.
If I call DbContext.SaveChanges() later, I get an odd DbUpdateConcurrencyException. If you catch this exception, you can compare database values and local values (see https://docs.microsoft.com/en-us/ef/ef6 ... oncurrency). But these values do not differ!
This seems to be a bug. I can try to create a minimal working example if needed.
If I call DbContext.SaveChanges() later, I get an odd DbUpdateConcurrencyException. If you catch this exception, you can compare database values and local values (see https://docs.microsoft.com/en-us/ef/ef6 ... oncurrency). But these values do not differ!
This seems to be a bug. I can try to create a minimal working example if needed.