/// <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)) })); }
/// <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)); }