Esempio n. 1
0
        public virtual async Task <IdentityResourcePropertiesDto> GetIdentityResourcePropertiesAsync(int identityResourceId, int page = 1, int pageSize = 10)
        {
            var identityResource = await IdentityResourceRepository.GetIdentityResourceAsync(identityResourceId);

            if (identityResource == null)
            {
                throw new UserFriendlyErrorPageException(string.Format(IdentityResourceServiceResources.IdentityResourceDoesNotExist().Description, identityResourceId), IdentityResourceServiceResources.IdentityResourceDoesNotExist().Description);
            }

            var pagedList = await IdentityResourceRepository.GetIdentityResourcePropertiesAsync(identityResourceId, page, pageSize);

            var apiResourcePropertiesDto = pagedList.ToModel();

            apiResourcePropertiesDto.IdentityResourceId   = identityResourceId;
            apiResourcePropertiesDto.IdentityResourceName = identityResource.Name;

            return(apiResourcePropertiesDto);
        }
Esempio n. 2
0
        public virtual async Task <IdentityResourcePropertiesDto> GetIdentityResourcePropertiesAsync(int identityResourceId, int page = 1, int pageSize = 10)
        {
            var identityResource = await IdentityResourceRepository.GetIdentityResourceAsync(identityResourceId);

            if (identityResource == null)
            {
                throw new UserFriendlyErrorPageException(string.Format(IdentityResourceServiceResources.IdentityResourceDoesNotExist().Description, identityResourceId), IdentityResourceServiceResources.IdentityResourceDoesNotExist().Description);
            }

            var pagedList = await IdentityResourceRepository.GetIdentityResourcePropertiesAsync(identityResourceId, page, pageSize);

            var identityResourcePropertiesAsync = pagedList.ToModel();

            identityResourcePropertiesAsync.IdentityResourceId   = identityResourceId;
            identityResourcePropertiesAsync.IdentityResourceName = identityResource.Name;

            await AuditEventLogger.LogEventAsync(new IdentityResourcePropertiesRequestedEvent(identityResourcePropertiesAsync));

            return(identityResourcePropertiesAsync);
        }