Home > Software design >  problems with identityuser role asp.net core
problems with identityuser role asp.net core

Time:02-20

enter image description here

enter image description here

What do I do to correct this?
I am trying to implement roles. My db context was formed in a scaffolding of the database, so I don't know which class I should derivate.

enter image description here

CodePudding user response:

The error is the type you are passing at .AddRoles(), it should be IdentityRole not IdentityUser.

Use the code below;

.AddRoles<IdentityRole>()
  • Related