Пример #1
0
        public List <CacheItem> GetAll(string itemId = "")
        {
            var final = new List <CacheItem>();

            var unmappedItems = _dbConnection.GetAll();
            var mappedItems   = _transferObjectMapper.MapToTransferCacheItems(unmappedItems);

            return(final);
        }
        public override string ToString()
        {
            var items  = _cacheRepo.GetAll();
            var retVal = new StringBuilder();

            retVal.AppendLine($"Count: {items.Count}");
            foreach (var item in items)
            {
                retVal.AppendLine($"{item.Key} = {item.Value}");
            }
            return(retVal.ToString());
        }
Пример #3
0
        public IEnumerable <TModel> GetAll()
        {
            var cacheEntities = _cacheRepository.GetAll();

            var models = new List <TModel>();

            foreach (var cacheEntity in cacheEntities)
            {
                models.Add(JsonConvert.DeserializeObject <TModel>(cacheEntity.Data));
            }

            return(models);
        }