Ejemplo n.º 1
0
 /// <summary>
 /// Gets API scopes by scope name.
 /// </summary>
 public virtual async Task <IEnumerable <IdentityServer4.Models.ApiScope> > FindApiScopesByNameAsync(IEnumerable <string> scopeNames)
 {
     return(await GetCacheItemsAsync(
                ApiScopeCache,
                scopeNames,
                async keys => await ApiScopeRepository.GetListByNameAsync(keys, includeDetails: true),
                (models, cacheKeyPrefix) => new List <IEnumerable <KeyValuePair <string, IdentityServer4.Models.ApiScope> > >
     {
         models.Select(x => new KeyValuePair <string, IdentityServer4.Models.ApiScope>(AddCachePrefix(x.Name, cacheKeyPrefix), x))
     }));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets API scopes by scope name.
        /// </summary>
        public virtual async Task <IEnumerable <IdentityServer4.Models.ApiScope> > FindApiScopesByNameAsync(IEnumerable <string> scopeNames)
        {
            var scopes = await ApiScopeRepository.GetListByNameAsync(scopeNames.ToArray(), includeDetails : true);

            return(ObjectMapper.Map <List <Volo.Abp.IdentityServer.ApiScopes.ApiScope>, List <IdentityServer4.Models.ApiScope> >(scopes));
        }