/// <summary> /// Gets identity resources by scope name. /// </summary> public virtual async Task <IEnumerable <IdentityServer4.Models.IdentityResource> > FindIdentityResourcesByScopeNameAsync(IEnumerable <string> scopeNames) { return(await GetCacheItemsAsync( IdentityResourceCache, scopeNames, async keys => await IdentityResourceRepository.GetListByScopeNameAsync(keys, includeDetails: true), (models, cacheKeyPrefix) => new List <IEnumerable <KeyValuePair <string, IdentityServer4.Models.IdentityResource> > > { models.Select(x => new KeyValuePair <string, IdentityServer4.Models.IdentityResource>(AddCachePrefix(x.Name, cacheKeyPrefix), x)) })); }