wandos
wandos

Reputation: 1619

Asp.net core 3.1 identity roles getting deleted

I am having an issue with identity roles in ASP.Net core 3.1. The data inside the AspNetRoleUserRoles keeps getting deleted.

I am not able to find out what is causing it. Is there a way to log these actions, and figure out where is the action is coming from.

Upvotes: 1

Views: 247

Answers (1)

wandos
wandos

Reputation: 1619

The issue was caused by having a modelBuilder.ApplyConfiguration(new RoleConfiguration()); in the ApplicationDbContext class.

Everytime the container will renetialize the roles where re-written and the previous roles got discarted.

Upvotes: 1

Related Questions