Exemple #1
0
        public async Task <IActionResult> Add()
        {
            var model = new UserViewModel
            {
                ApplicationRoles = _roleManager.Roles?.ToList(),
                UsersGroups      = await _userGroupManager.GetAllUsersGroups()
            };

            return(PartialView(model));
        }
Exemple #2
0
 public async Task <IEnumerable <UsersGroupModel> > GetAllUsersGroups()
 {
     return(await _memoryCache.GetOrCreateAsync("AllUsersGroups", (entry) =>
     {
         entry.SlidingExpiration = Duration;
         return _usersGroupManager.GetAllUsersGroups();
     }));
 }
Exemple #3
0
        public async Task <IActionResult> List()
        {
            var viewModel = await _manager.GetAllUsersGroups();

            return(View(viewModel));
        }