Exemplo n.º 1
0
        public virtual async Task <HashSet <T> > GetValuesAsync()
        {
            if (!_cache.TryGetValue(Key, out HashSet <T> entities))
            {
                var values = await _graphQLService.GetValuesAsync <IEnumerable <T> >(Method, Query);

                if (values == null)
                {
                    return(null);
                }
                values   = Sort(values);
                entities = values.ToHashSet();
                _cache.Set(Key, entities);
            }

            return(entities);
        }