ObjectContext.SaveChanges Method (SaveOptions)
Persists all updates to the data source with the specified SaveOptions.
Assembly: System.Data.Entity (in System.Data.Entity.dll)
An optimistic concurrency violation has occurred.
This enumeration has a FlagsAttribute that allows for a bitwise combination of its member values.
To make sure that objects on the client have been updated by data source-side logic, you can call the Refresh method with the StoreWins value after you call SaveChanges. The SaveChanges method operates in a transaction. SaveChanges will roll back that transaction and throw an exception if any one of the dirty ObjectStateEntry objects cannot be persisted.
If an optimistic concurrency violation has occurred, an OptimisticConcurrencyException is thrown. You can resolve an optimistic concurrency violation by catching it, calling the Refresh method with the StoreWins or ClientWins values, and then calling the SaveChanges method again. For more information, see How to: Manage Data Concurrency in the Object Context.
Available since 4.0