Exemplo n.º 1
0
        public virtual async Task <Resources> GetAllResourcesAsync()
        {
            var identityResources = await _identityResourceRepository.GetListAsync(includeDetails : true);

            var apiResources = await _apiResourceRepository.GetListAsync(includeDetails : true);

            return(new Resources(
                       _objectMapper.Map <List <IdentityResource>, IdentityServer4.Models.IdentityResource[]>(identityResources),
                       _objectMapper.Map <List <ApiResources.ApiResource>, ApiResource[]>(apiResources)
                       ));
        }
Exemplo n.º 2
0
        public virtual async Task <PagedResultDto <IdentityResourceDto> > GetListAsync(
            PagedAndSortedResultRequestDto input)
        {
            var list = await _resourceRepository.GetListAsync(input.Sorting, input.SkipCount,
                                                              input.MaxResultCount);

            var totalCount = await _resourceRepository.GetCountAsync();

            return(new PagedResultDto <IdentityResourceDto>(
                       totalCount,
                       ObjectMapper.Map <List <IdentityResource>, List <IdentityResourceDto> >(
                           list)
                       ));
        }