Example #1
0
        public async Task <IActionResult> Index()
        {
            var users = await this.users.AllAsync();

            var roles = await this.roleManager
                        .Roles
                        .Select(r => new SelectListItem
            {
                Text  = r.Name,
                Value = r.Name
            })
                        .ToListAsync();

            var model = new UserListingsViewModel
            {
                Users = users,
                Roles = roles
            };

            return(View(model));
        }
        public async Task <IActionResult> Index()
        {
            var users = await this.userService.AllAsync();

            var roles = await this.roleManager
                        .Roles
                        .Where(r => r.Name != MasterAdminRole)
                        .Select(r => new SelectListItem
            {
                Text  = r.Name,
                Value = r.Name
            })
                        .ToListAsync();

            var vm = new UserListingsViewModel
            {
                Users = users,
                Roles = roles
            };

            return(this.View(vm));
        }