/// <summary> /// Save new or updated Item Cache. /// </summary> /// <param name="forceOverWrite"> /// If 'True', overwrite existing (if exists) Item Cache. /// If 'False', if exists Item Cache return exception (RedisCacheException). /// </param> /// <returns></returns> public long Save(bool forceOverWrite) { ManagementItemsCache m = new ManagementItemsCache(); long result = m.Add <T>(this.Key, this.Value, this.SlidingExpiration, this.AbsoluteExpiration, forceOverWrite); return(result); }
/// <summary> /// Return (if exists) Item Cache. /// </summary> /// <param name="key">Item Cache Key</param> /// <returns></returns> public static ItemCache <T> GetItem(string key) { ManagementItemsCache m = new ManagementItemsCache(); return(m.GetItemCache <T>(key)); }
/// <summary> /// Verify if existing Item Cache. /// </summary> /// <param name="key">Item Cache Key</param> /// <returns></returns> public static bool ExistItem(string key) { ManagementItemsCache m = new ManagementItemsCache(); return(m.Exist(key)); }
/// <summary> /// Delete existing Item Cache. /// </summary> /// <param name="key">Item Cache Key</param> /// <returns></returns> public static bool DeleteItem(string key) { ManagementItemsCache m = new ManagementItemsCache(); return(m.Delete(key)); }