Exemple #1
0
        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)));
        }
Exemple #2
0
 public IActionResult DogManagement()
 {
     return(View(_mapper.Map <IEnumerable <Dog>, IEnumerable <DogModel> >(_repository.GetDogs())));
 }