public static void RemoveCacheData(this HttpContextBase context) { if (context == null) { throw new ArgumentNullException("context"); } context.Cache.Remove(context.CacheID().ToString("n")); context.Session.Remove(SessionKeys.Cache); }
public static void SetCacheData(this HttpContextBase context, DataSet ds) { if (context == null) { throw new ArgumentNullException("context"); } var key = context.CacheID().ToString("n"); context.Cache.Insert(key, ds, null, DateTime.Now.AddMinutes(10), System.Web.Caching.Cache.NoSlidingExpiration); }
public static DataSet GetCacheData(this HttpContextBase context) { if (context == null) { throw new ArgumentNullException("context"); } var key = context.CacheID().ToString("n"); var obj = context.Cache[key]; if (obj == null) { return(null); } else { return((DataSet)obj); } }