Answers for "identity add role to user"

0

identity add role to user

var user = new JobUser { UserName = model.Email, Email = model.Email };
var result = await UserManager.CreateAsync(user, model.Password);
if (result.Succeeded)
{
    //add this to add role to user
     await UserManager.AddToRoleAsync(user.Id, "Name of your role");
}
Posted by: Guest on December-12-2020

Code answers related to "identity add role to user"

Browse Popular Code Answers by Language