Beispiel #1
0
        private IEnumerable <Video> GetVideos()
        {
            string cacheKey = "vippyvideos";

            var videos = CacheManager.Get(cacheKey) as IEnumerable <Video>;

            if (videos == null)
            {
                videos = _vippyWrapper.GetVideos().Result;

                CacheManager.Insert(cacheKey, videos, new CacheEvictionPolicy(null, null, null, TimeSpan.FromMinutes(2), CacheTimeoutType.Absolute));
            }

            return(videos);
        }
Beispiel #2
0
        private IEnumerable<Video> GetVideos()
        {
            string cacheKey = "vippyvideos";

            var videos = HttpRuntime.Cache.Get(cacheKey) as List<Video>;

            if (videos == null)
            {
                var wrapper = new VippyWrapper.VippyWrapper(VippyConfiguration.ApiKey,
                    VippyConfiguration.SecretKey);

                videos = (wrapper.GetVideos().Result).ToList();

                HttpRuntime.Cache.Insert(cacheKey, videos, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(1));
            }

            return videos;
        }
Beispiel #3
0
        private IEnumerable <Video> GetVideos()
        {
            string cacheKey = "vippyvideos";

            var videos = HttpRuntime.Cache.Get(cacheKey) as List <Video>;

            if (videos == null)
            {
                var wrapper = new VippyWrapper.VippyWrapper(VippyConfiguration.ApiKey,
                                                            VippyConfiguration.SecretKey);

                videos = (wrapper.GetVideos().Result).ToList();

                HttpRuntime.Cache.Insert(cacheKey, videos, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(1));
            }

            return(videos);
        }