I want users to be able to edit what they already created and save the changes to the db. When I test editing out, I get this error:
SqlException: The UPDATE statement conflicted with the FOREIGN KEY constraint "FK_REPTILES_AspNetUsers_ApplicationUserId". The conflict occurred in database "PetAdoptDB", table "dbo.AspNetUsers", column "Id"
I tried modifying the foreign key to cascade instead of no action which I found here Link, but, I still get the error.
While debugging I noticed that the ApplicationUser is null and ApplicationUserId equals 0 when running
_context.Update(reptile);
Not sure if that's the problem or not and if so, how to fix it.