public async Task <BaseSelectResponse <GetClientsViewModel> > Handle(GetClientsQuery request, CancellationToken cancellationToken) { var clients = await _configurationRepository .All <Client>().AsNoTracking() .Select(GetClientsViewModel.Projection) .Skip((request.PageNumber - 1) * request.PageSize) .Take(request.PageSize) .ToArrayAsync(); var clientsCount = await _configurationRepository.All <Client>().CountAsync(); var response = new BaseSelectResponse <GetClientsViewModel> { Count = clientsCount, Values = clients }; return(response); }
public async Task <BaseSelectResponse <GetApiResourcesViewModel> > Handle(GetApiResourcesQuery request, CancellationToken cancellationToken) { var apiResources = await _configurationRepository .All <IdentityServer4.EntityFramework.Entities.ApiResource>().AsNoTracking() .Select(GetApiResourcesViewModel.Projection) .Skip((request.PageNumber - 1) * request.PageSize) .Take(request.PageSize) .ToArrayAsync(); var apiResourcesCount = await _configurationRepository.All <IdentityServer4.EntityFramework.Entities.ApiResource>().CountAsync(); var response = new BaseSelectResponse <GetApiResourcesViewModel> { Count = apiResourcesCount, Values = apiResources }; return(response); }