Base solution for your next web application
Open Closed

How to remove a userrole for a user #1042


User avatar
0
hakan created

To add a Userrole I use this( from DefaultTenantRoleAndUserBuilder.cs)

_context.UserRoles.Add(new UserRole(adminUserForDefaultTenant.Id, adminRoleForDefaultTenant.Id));
 _context.SaveChanges();

But how to remove a Userrole?

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

1 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Always use UserManager to add/remove a role to/from a user.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)