public List <WarframeItem> GetByCodexSection(CodexSection codexSection) { List <ItemCache> caches = new ItemCacheRepository(_unitOfWork).GetByCodexSection(codexSection); if (caches == null && !caches.Any() || caches.First().UpdatedTimestamp < DateTime.Now.AddDays(-2)) { List <ItemCategory> itemCategories = new ItemCategoryRepository(_unitOfWork).GetByCodexSection(codexSection); caches = RedownloadCache().Where(x => itemCategories.Select(y => y.ID).Contains(x.ItemCategoryID)).ToList(); } string test = "[" + string.Join(",", caches.Select(x => x.Data)) + "]"; return(JsonConvert.DeserializeObject <List <WarframeItem> >(test)); }