Exemple #1
0
        /// <inheritdoc />
        public void Put(object key, object value)
        {
            if (key == null)
            {
                if (log.IsErrorEnabled)
                {
                    log.Error("null key passed to 'Put'");
                }
                throw new ArgumentNullException("key", "null key not allowed");
            }
            if (value == null)
            {
                if (log.IsErrorEnabled)
                {
                    log.Error("null value passed to 'Put'");
                }
                throw new ArgumentNullException("value", "null value not allowed");
            }
            string cacheKey = GetCacheKey(key);

            if (log.IsDebugEnabled)
            {
                log.Debug(String.Format("setting value {1} for key {0}", cacheKey, value));
            }
            system.Add(cacheKey, new DictionaryEntry(key, value));
        }
        /// <inheritdoc />
        public override void Put(object key, object value)
        {
            if (key == null)
            {
                log.Error("null key passed to 'Put'");
                throw new ArgumentNullException("key", "null key not allowed");
            }
            if (value == null)
            {
                log.Error("null value passed to 'Put'");
                throw new ArgumentNullException("value", "null value not allowed");
            }
            string cacheKey = GetCacheKey(key);

            log.Debug("setting value {1} for key {0}", cacheKey, value);
            system.Add(cacheKey, new DictionaryEntry(key, value));
        }