public void Insert(string sessionId, string key, object value, bool enableRetry) { //int retry = _operationRetry; //do{ // try // { _cache.Insert(key, TagUtil.CreateTaggedCacheItem(value)); // break; // } // catch (Exception ex) // { // string message = ex.Message; // if (message != null && !(message.ToLower().Contains("connection with server") || // message.ToLower().Contains("no server is available")) || !enableRetry) // { // throw; // } // if (retry <= 0) // throw ex; // retry--; // if (_operationRetryDelayInterval > 0) // Thread.Sleep(_operationRetryDelayInterval); // } //} //while (retry >= 0); }
public void Add(string key, object value) { Alachisoft.NCache.Web.Caching.Cache cache = (Alachisoft.NCache.Web.Caching.Cache)_caches[_primaryCache]; if (cache != null) { cache.Add(key, TagUtil.CreateTaggedCacheItem(value)); } }
public void InsertAsync(string sessionId, string key, object value, CacheDependency dependency, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority) { Alachisoft.NCache.Web.Caching.Cache cache = null; object obj = null; GetCache(sessionId, key, out obj, "", "", out cache, false); if (cache != null) { cache.InsertAsync(key, TagUtil.CreateTaggedCacheItem(value, dependency, absoluteExpiration, slidingExpiration, priority), DSWriteOption.None, null); } }
public void InsertAsync(string sessionId, string key, object value) { Alachisoft.NCache.Web.Caching.Cache cache = null; object obj = null; GetCache(sessionId, key, out obj, "", "", out cache, false); if (cache != null) { cache.InsertAsync(key, TagUtil.CreateTaggedCacheItem(value), null, null, null); } }
public void Add(string key, object value) { _cache.Add(key, TagUtil.CreateTaggedCacheItem(value)); }
public void Insert(string key, object value) { _cache.Insert(key, TagUtil.CreateTaggedCacheItem(value)); }
public void Insert(string sessionId, string key, object value, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority) { _cache.Insert(key, TagUtil.CreateTaggedCacheItem(value, absoluteExpiration, slidingExpiration, priority)); }
public void Add(string sessionId, string key, object value, CacheDependency dependency, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority) { _cache.Add(key, TagUtil.CreateTaggedCacheItem(value, dependency, absoluteExpiration, slidingExpiration, priority)); }