public async Task <IActionResult> DeleteRole(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var user = await GetUserById(id);

            var vm = new UserManagementDeleteRoleVM
            {
                UserId       = id,
                Email        = user.Email,
                CurrentRoles = new SelectList(await _userManager.GetRolesAsync(user))
            };

            return(View(vm));
        }
        public async Task <IActionResult> DeleteRole(UserManagementDeleteRoleVM rvm)
        {
            var user = await GetUserById(rvm.UserId);

            if (ModelState.IsValid)
            {
                var result = await _userManager.RemoveFromRoleAsync(user, rvm.OldRole);

                if (result.Succeeded)
                {
                    return(RedirectToAction("Index"));
                }
                foreach (var error in result.Errors)
                {
                    ModelState.AddModelError(error.Code, error.Description);
                }
            }
            rvm.Email        = user.Email;
            rvm.CurrentRoles = new SelectList(await _userManager.GetRolesAsync(user));
            return(View(rvm));
        }