示例#1
0
        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());
        }
示例#2
0
 internal DockPanelContainer.Row InsertRow(User user)
 {
     UsersWithRole.Add(user);
     return(Container.InsertRow(user));
 }