79683347

Date: 2025-06-28 21:36:52
Score: 2
Natty:
Report link

So, I was having the same issue. When I checked the Departments table in the database, the ConcurrencyToken field was populated with a GUID of 00000000-0000-0000-0000-000000000000. This was due to the EF migration builder creating a default value for the GUID field in the Up() method. Check your <Timestamp>_RowVersion.cs file for this.

Being a newbie, I didn't know how to manage this. I just decided to run the following commands to drop the DB and create a new migration

  1. drop the database: dotnet ef database drop

  2. Delete all files in the Migrations folder of the project

  3. create a new migration: dotnet ef migrations add <Migration name>

  4. Update the database: dotnet ef database update

Then build and run your application. You should notice that a unique GUID is created for each department or whatever entity set you are applying the GUID field to.

In hindsight, I think removing the default value line in the <Timestamp>_RowVersion.cs file would have worked, but I didn't think that through since I was so frustrated. So, try that first before dropping the database, and please let me know if that worked.

Reasons:
  • RegEx Blacklisted phrase (2.5): please let me know
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Keith C