public async Task <IActionResult> OnGetAsync() { Users = await _userManager.Users.ToListAsync(); Roles = await _roleManager.Roles.ToListAsync(); foreach (var user in Users) { var roles = await _userManager.GetRolesAsync(user); if (Role != null && roles.Contains(Role.Name)) { var userWithRoles = new UserWithRoles(user, roles.ToList()); UsersWithRole.Add(userWithRoles); } else if (Role == null) { var userWithRoles = new UserWithRoles(user, roles.ToList()); UsersWithRole.Add(userWithRoles); } } return(Page()); }
internal DockPanelContainer.Row InsertRow(User user) { UsersWithRole.Add(user); return(Container.InsertRow(user)); }