public void OnGet() { var rolename = RoleManagers.FindByIdAsync(RoleId).Result.Name; Users = UserManagers.GetUsersInRoleAsync(rolename).Result.ToList(); RoleName = rolename; }
public IActionResult OnGetAddUserRole(string roleId) { var rolename = RoleManagers.FindByIdAsync(RoleId).Result.Name; var Usersinrole = UserManagers.GetUsersInRoleAsync(rolename).Result.ToList(); var UserList = _context.Users.ToList(); var Usersnotinrole = UserList.Except(Usersinrole).ToList(); var Usersrole = new UserRole(); Usersrole.RoleId = roleId; Usersrole.Users = Usersnotinrole; return(Partial("_adduserole", Usersrole)); }