-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
The example shows only ONE valid way to deal with the concurrency issue - with the assumption that the exception caught the issue and the original values should be re-read from the database as such and maybe the user needs to be informed.
What it doesn't talk about, nor show is what if the issue is NOT an issue - that the desired functionality was to CHANGE a key field? I can manually use the SQL Manager to change a key field - as there are no conflicts with other tables (dependencies) - but EF Core will throw a concurrency exception as if there is.
What I don't know is WHAT needs to be done to complete the primary key edit? Is this an issue due to having the same records displayed in a DataGrid view? (And now I'm trying to pragmatically edit a primary key field and save the changes?).
You need to enhance the example and not assume that the concurrency always catches a conflict - as there may not really be one.
Thanks
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 649fbab8-b960-6873-14bf-188d14757fee
- Version Independent ID: f5ee3135-54c8-689c-e28b-b203b376bd6f
- Content: Handling Concurrency Conflicts - EF Core
- Content Source: entity-framework/core/saving/concurrency.md
- Product: entity-framework
- Technology: entity-framework-core
- GitHub Login: @ajcvickers
- Microsoft Alias: avickers