Esempio n. 1
0
 public void Delete(ICacheKey key)
 {
     if (this.cache.ContainsKey(key.GetName()))
     {
         this.cache.Remove(key.GetName());
     }
 }
Esempio n. 2
0
        public TResult Get <TResult>(ICacheKey key) where TResult : class
        {
            lock (cacheBuffer.GetOrAdd(key.GetName(), key))
            {
                if (IsExpires(key))
                {
                    Delete(key);
                }

                return(this.init.Provider.Get <TResult>(key));
            }
        }
Esempio n. 3
0
 public void Set <T>(ICacheKey key, T instance) where T : class
 {
     this.cache.Set(key.GetName(), instance);
 }
Esempio n. 4
0
 public T Get <T>(ICacheKey key) where T : class
 {
     return(this.cache.ContainsKey(key.GetName()) ? this.cache[key.GetName()] as T : null);
 }
Esempio n. 5
0
 public void Set <T>(ICacheKey key, T instance) where T : class
 {
     Guard.NotNull("key", key);
     this.memcached.Store(StoreMode.Set, key.GetName(), instance);
 }
Esempio n. 6
0
 public T Get <T>(ICacheKey key) where T : class
 {
     Guard.NotNull("key", key);
     return(this.memcached.Get <T>(key.GetName()));
 }
Esempio n. 7
0
 public void Delete(ICacheKey key)
 {
     Guard.NotNull("key", key);
     this.memcached.Remove(key.GetName());
 }
Esempio n. 8
0
 public TResult Get <TResult>(ICacheKey key)
 {
     return(Get <TResult>(key.GetName()));
 }
Esempio n. 9
0
 public TResult Retrieve <TResult>(ICacheKey key, Func <TResult> callback, CacheOptions cacheOptions = null)
 {
     return(Retrieve(key.GetName(), callback, cacheOptions));
 }
 public void Delete(ICacheKey key)
 {
     HttpRuntime.Cache.Remove(key.GetName());
 }
Esempio n. 11
0
 public void Delete(ICacheKey key)
 {
     this.init.Provider.Delete(key.GetName());
 }
 public void Set <T>(ICacheKey key, T instance) where T : class
 {
     HttpRuntime.Cache.Insert(key.GetName(), instance);
 }
 public T Get <T>(ICacheKey key) where T : class
 {
     return(HttpRuntime.Cache.Get(key.GetName()) as T);
 }
Esempio n. 14
0
 public void Set <T>(ICacheKey key, T instance) where T : class
 {
     this.memcached.Store(StoreMode.Set, key.GetName(), instance);
 }
Esempio n. 15
0
 public T Get <T>(ICacheKey key) where T : class
 {
     return(this.memcached.Get <T>(key.GetName()));
 }
Esempio n. 16
0
 public void Delete(ICacheKey key)
 {
     this.memcached.Remove(key.GetName());
 }