public IActionResult Dogs() { List <Dog> dogListCached = null; dogListCached = _memoryCache.GetOrCreate("Dogs", entry => { entry.SlidingExpiration = TimeSpan.FromSeconds(60); entry.Priority = CacheItemPriority.High; return(_repository.GetDogs().ToList()); }); return(View(_mapper.Map <IEnumerable <Dog>, IEnumerable <DogModel> >(dogListCached))); }
public IActionResult DogManagement() { return(View(_mapper.Map <IEnumerable <Dog>, IEnumerable <DogModel> >(_repository.GetDogs()))); }