コード例 #1
0
        protected override void AddToCache(string key, object value, CacheItemPriority normal, object o, TimeSpan timeSpan, CacheOptions? cacheOptions)
        {
            if (DisabledDueToTesting) return;

            _cacheManager.Add(key, value, CacheItemPriority.Normal, null,
                             new AbsoluteTime(timeSpan));

            if (cacheOptions != null && IsCacheStale(key))
            {
                ClearStaleFlag(key);
            }
        }
コード例 #2
0
        protected override void AddToCache <T>(string key, T value, CacheItemPriority normal, object o,
                                               TimeSpan timeSpan)
        {
            if (DisabledDueToTesting)
            {
                return;
            }

            _cacheManager.Add(key, value, CacheItemPriority.Normal, null,
                              new AbsoluteTime(timeSpan));

            if (IsCacheStale(key))
            {
                ClearStaleFlag(key);
            }
        }