コード例 #1
0
        public async Task <IEnumerable <IdentityResource> > FindIdentityResourcesByScopeAsync(IEnumerable <string> scopeNames)
        {
            if (scopeNames == null ||
                !scopeNames.Any())
            {
                return(new List <IdentityResource>());
            }

            var identityResources = await _identityResourceService.GetByScopes(scopeNames.ToList());

            if (identityResources.IsSuccess)
            {
                if (identityResources.Data != null &&
                    identityResources.Data.Any())
                {
                    return(_mapper.Map <IEnumerable <IdentityResourceDto>, IEnumerable <IdentityResource> >(identityResources.Data));
                }
            }

            return(new List <IdentityResource>());
        }