示例#1
0
        public void OnGet()
        {
            var rolename = RoleManagers.FindByIdAsync(RoleId).Result.Name;

            Users    = UserManagers.GetUsersInRoleAsync(rolename).Result.ToList();
            RoleName = rolename;
        }
示例#2
0
        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));
        }