-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elaborate on concurrency tokens in detached use cases #860
Comments
It seems the example above is incorrect. The concurrency token is |
That's correct in this case. The example code was copy pasted from another documentation page. However, the same principle applies. |
I also spent way too long today struggling with this until I found a stack overflow post showing Original Value. Can someone explain why we need to manually manipulate the original value to enable this functionality? Why won't it use whatever value is on the entity? |
See also dotnet/efcore#18505 |
See also: dotnet/efcore#27865 |
When you're updating an entity in a detached situation (e.g. MVC or SPA) and want to make use of a concurrency token, it's important to set the OriginalValue of a concurrency token to the CurrentValue as mentioned on https://docs.microsoft.com/en-us/aspnet/core/data/ef-rp/concurrency?view=aspnetcore-2.1&tabs=visual-studio. It took me several hours to realise this. It might help others if this situation was elaborated on this page.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: