public async Task <IActionResult> Add() { var model = new UserViewModel { ApplicationRoles = _roleManager.Roles?.ToList(), UsersGroups = await _userGroupManager.GetAllUsersGroups() }; return(PartialView(model)); }
public async Task <IEnumerable <UsersGroupModel> > GetAllUsersGroups() { return(await _memoryCache.GetOrCreateAsync("AllUsersGroups", (entry) => { entry.SlidingExpiration = Duration; return _usersGroupManager.GetAllUsersGroups(); })); }
public async Task <IActionResult> List() { var viewModel = await _manager.GetAllUsersGroups(); return(View(viewModel)); }