I have a Blazor Interactive Server app. On several of my pages I have a component where the user can register for an event. There are 4 buttons (No, Undecided, Interested, Attending). When they click the button, that fires an event that reads 2 records from the DB, updates them with the signup status, and saves them.
Users are quickly clicking several buttons (no idea why). The end result is I am getting a DbUpdateConcurrencyException because it reads the records in the several event handler calls, updates them, then goes to save them and all after the first throw a DbUpdateConcurrencyException.
Is there a way to force this event handler, for each session, to be processed synchronously? The records involved are user records so there is no conflict across sessions unless a user connects via 2 browsers and clicks at the same time – in which case tough.