public override IList <BaseEntityResultDTO> GetEntities(EntitySearch search)
        {
            var type     = search == null ? Type : search.Type;
            var cacheKey = $"{type}:{search.CalculateHash()}";

            return(_cacheService.GetOrAdd($"entities:{cacheKey}", () => base.GetEntities(search)));
        }
Ejemplo n.º 2
0
        public IList <PidUriTemplateFlattened> GetFlatPidUriTemplates(EntitySearch entitySearch)
        {
            var cacheKey            = entitySearch == null ? Type : entitySearch.CalculateHash();
            var flatPidUriTemplates = _cacheService.GetOrAdd($"list:flattened:{cacheKey}", () =>
            {
                var templates = GetEntities(entitySearch);
                return(templates.Select(template => GetFlatPidUriTemplateByPidUriTemplate(template)).ToList());
            });

            return(flatPidUriTemplates);
        }
        public override IList <ExtendedUriTemplateResultDTO> GetEntities(EntitySearch search)
        {
            var cacheKey = search == null ? Type : search.CalculateHash();
            var extendedUriTemplateList =
                _cacheService.GetOrAdd($"entities:{cacheKey}", () =>
            {
                var extendedUriTemplate = base.GetEntities(search);
                return(extendedUriTemplate
                       .OrderBy(x => x.Properties.GetValueOrNull(COLID.Graph.Metadata.Constants.ExtendedUriTemplate.HasOrder, true))
                       .ToList());
            });

            return(extendedUriTemplateList);
        }
        public override IList <ConsumerGroupResultDTO> GetEntities(EntitySearch search)
        {
            var cacheKey = search == null ? Type : search.CalculateHash();

            return(_cacheService.GetOrAdd($"entities:{cacheKey}", () => base.GetEntities(search)));
        }