What is client wins and store wins mode in Entity Framework concurrency?

Technology CommunityCategory: Entity FrameworkWhat is client wins and store wins mode in Entity Framework concurrency?
VietMX Staff asked 3 years ago

Client wins and store wins are actions which you would like to take when concurrency happens. In store wins / database wins, the data from the server is loaded into your entity objects. Client wins is opposite to stored wins, data from the entity object is saved to the database.

We need to use the Refresh method of the Entity Framework context and provide the RefreshMode enum values. Below is a simple code snippet which executes ClientWins.

Context.Refresh(System.Data.Objects.RefreshMode.ClientWins,Obj);