If you needed to add a user to a specific role immediately after creating them programmatically, which method of the UserManager class would you use?

  • AddToRoleAsync
  • AddClaimAsync
  • AddToRole
  • AddPasswordAsync
To add a user to a specific role immediately after creating them programmatically, you would use the AddToRoleAsync method of the UserManager class. This method allows you to assign a user to a role, granting them the associated permissions and access rights.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *