Ejemplo n.º 1
0
        public virtual async Task <ActionResult> Roles(int roleId)
        {
            var user = await CustomUser.FindByIdAsync(User.Identity.GetUserId());

            await CustomUser.AddToRoleAsync(user.Id, Enum.GetName(typeof(DTO.Constants.RolesEnum), roleId));

            await CustomUser.AddClaimAsync(user.Id, new Claim(ClaimTypes.Role, roleId.ToString()));

            await CustomSignIn.SignInAsync(user, false, false);

            return(RedirectToAction(Mvc.Manage.Roles()));
        }