public async Task <IEnumerable <ApiResource> > FindApiResourcesByScopeAsync(IEnumerable <string> scopeNames) { if (scopeNames == null || !scopeNames.Any()) { return(new List <ApiResource>()); } var apiResources = await _apiResourceService.GetByScopes(scopeNames.ToList()); if (apiResources.IsSuccess) { if (apiResources.Data != null && apiResources.Data.Any()) { return(_mapper.Map <IEnumerable <ApiResourceDto>, IEnumerable <ApiResource> >(apiResources.Data)); } } return(new List <ApiResource>()); }