When I want to insert to log table in OnActionExecuted (action filter) after endpoint executed I get below error:
Npgsql.PostgresException (0x80004005): 23503: update or delete on table "Roles" violates foreign key constraint "FK_RoleId" on table "Users"
But I dont insert any of these table and a table has no foreign key column which I want to insert data. My insert comment is like this:
ctx.LogResponses.Add(log);
ctx.SaveChanges();
How can I solve this?
User contributions licensed under CC BY-SA 3.0