Esempio n. 1
0
        public async Task Delete(DeleteUserFromRoleInputDto model)
        {
            log.LogInformation("Deleting user {0} from role {1}", model.UserName, model.RoleName);

            var user = await userManager.FindByNameAsync(model.UserName);

            if (user != null)
            {
                await userManager.RemoveFromRoleAsync(user, model.RoleName);
            }
        }
Esempio n. 2
0
        public async Task <ActionResult> Delete(string roleName, string userName)
        {
            DeleteUserFromRoleInputDto model = new DeleteUserFromRoleInputDto();

            model.RoleName = roleName;
            model.UserName = userName;

            await userRolesServices.Delete(model);

            return(Ok());
        }