Esempio n. 1
0
 public CacheItem(string key, object value, int priority, IExpirationSpecifier[] expirationSpecifierList)
 {
     this.Key = key;
     this.Value = value;
     this.Priority = priority;
     this.ExpirationSpecifierList = expirationSpecifierList;
 }
Esempio n. 2
0
        /// <summary>
        /// To set an item in cache
        /// </summary>
        /// <param name="key">cache item key</param>
        /// <param name="value">cache value</param>
        /// <param name="priority">priority</param>
        /// <param name="expirationSpecifierList">list of expiration specifiers</param>
        public void Set(string key, object value, int priority, IExpirationSpecifier[] expirationSpecifierList)
        {
            Guard.Assert(key != null, "Cache key cannot be null");
            Guard.Assert(value != null, "Cache value cannot be null");
            Guard.Assert(priority >= HIGHEST_PRIORITY && priority <= LOWEST_PRIORITY, "Invalid priority {0}", priority);

            _cacheStore.Set(new CacheItem(key, value, priority, expirationSpecifierList));
        }