Exemple #1
0
        public void Set(string key, object obj, CacheInfo info)
        {
            if(obj==null)
            {
                CacheInfo trash=null;
                Cache.TryRemove(key, out obj);
                return;
            }

            Cache[key]=obj;
        }
Exemple #2
0
 public void Set(string key, object obj, CacheInfo info=null)
 {
     if(obj==null)
     {
         HttpRuntime.Cache.Remove(key);
     }
     DateTime absolute=Cache.NoAbsoluteExpiration;
     if(info.AbsoluteExpirationFromNow!=null)
     {
         absolute=DateTime.Now;
         absolute.Add(info.AbsoluteExpirationFromNow.Value);
     }
     HttpRuntime.Cache.Insert(key, obj, null, absolute, info.SlidingExpiration ?? Cache.NoSlidingExpiration, ConvertPriority(info.Priority), null);
 }