public void Put(string key, TCacheValue value, ExpiredMode mode, TimeSpan timespan) { ExpirationMode expiretionMode = CacheUtility.ConvertFromCustomExpiredMode(mode); CacheItem <TCacheValue> item = new CacheItem <TCacheValue>(key, value, expiretionMode, timespan); cacheManger.Put(item); }
public static ExpirationMode ConvertFromCustomExpiredMode(ExpiredMode mode) { switch (mode) { case ExpiredMode.Default: return(ExpirationMode.Default); case ExpiredMode.None: return(ExpirationMode.None); case ExpiredMode.Sliding: return(ExpirationMode.Sliding); case ExpiredMode.Absolute: return(ExpirationMode.Absolute); default: return(ExpirationMode.None); } }