I have situation when I have 2 pods that getting requests to update status of object lets call him user, he have 3 statuses : new, verified and failed. they getting in parallel the entity with status new. they are updating the user status one to failed and one to verified. im using to bulkUpdate of DbContextBulkExtensions to update many users. I want that this case will throw me exception.
I saw there is soultion of ConcurrencyCheck attribute in c# data annotation and it working on regular update - but in DbContextBulkExtensions.bulkUpdate its not working. anyone know how to make that work in bulkUpdate?
According to the README, EFCore.BulkExtensions is able to do concurrency checks on the timestamp of each row. To enable, you can pass a
BulkConfig-object withDoNotUpdateIfTimeStampChanged = truetodbContext.BulkUpdate. Non-updated entities are returned toBulkConfig.TimeStampInfo.A possible example for your case:
... or as pattern