I'm working on a simple webpage (functioning as a homepage) with blazor (server). My current goal is to create a contact form at the bottom of the page, where customers can send a message to staff.
I created an EditForm using a model and used MailKit in the code fragment to send the message submitted by the EditForm via our mail server. This worked as expected until...
A co'worker told me this approach was not feasible for the following reason: While one client visiting the website and submitting the form works, it does not work as intended when there are multiple clients accessing the site and editing the form:
E.g. if two clients connect to the website and fill out the form and then submit it simultaneously, the data submited is messed up and mixed between the two accessing sessions. How can this be? I though Blazor would handle these requests asynchronously. I was told the issue lies in the Datacontext being the same for every session and thus all clients editing the same instance of a static object (the EditForm).
What must I change to get the expected behaviour? Thanks in advance!