Hello, I have an issue with Entity Framework. In my application, I have created an endpoint for creating employee accounts, which creates an account using Identity, and also creates the Employee and EmployeeProfile models. When I call the endpoint, I get the following error:
Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded.
Can anyone point me in the right direction as to where the problem might lie and what I should fix? I’m attaching screenshots of the code.