As the name state, it’s used to prevent concurrency update conflict.
For example, there’s a UserA named Peter in the database
2 admins open the editor page of UserA, want to update this user.
Admin_1opened the page, and saw user called Peter.Admin_2opened the page, and saw user called Peter (obviously).Admin_1updated user name to Tom, and save data. NowUserAin the db named Tom.Admin_2updated user name to Thomas, and try to save it.
What would happen if there’s no ConcurrencyStamp is Admin_1’s update will be overwritten by Admin_2’s update.
But since we have ConcurrencyStamp, when Admin_1/Admin_2 loads the page, the stamp is loaded. When updating data this stamp will be changed too.
So now step 5 would be system throw exception telling Admin_2 that this user has already been updated, since he ConcurrencyStamp is different from the one he loaded.