Пример #1
0
        public object Get(string key, CacheGetOptions options)
        {
            object value = _cacheClient.Get(key, options);

            LogGet(key, value, options);
            return(value);
        }
Пример #2
0
        /// <summary>
        /// Returns the value associated with the given key.
        /// </summary>
        /// <param name="key">A key of the item to return from cache.</param>
        /// <param name="options">The options <see cref="CacheGetOptions"/> to use when making a request.</param>
        /// <returns>The value stored in the cache.</returns>
        public object Get(string key, CacheGetOptions options)
        {
            Guard.ArgumentNotNullOrEmptyString(key, "key");
            Guard.ArgumentNotNull(options, "options");

            object value = this.cacheManager.GetData(key);

            if (options.AutoRemove)
            {
                Remove(key);
            }

            return(value);
        }
 internal object DoGet(bool isPublic, string key, CacheGetOptions getOptions)
 {
     object obj2;
     CacheKey cacheKey = new CacheKey(key, isPublic);
     CacheEntry entry = this.UpdateCache(cacheKey, null, false, CacheItemRemovedReason.Removed, out obj2);
     if (entry == null)
     {
         return null;
     }
     if ((getOptions & CacheGetOptions.ReturnCacheEntry) != CacheGetOptions.None)
     {
         return entry;
     }
     return entry.Value;
 }
Пример #4
0
        internal object DoGet(bool isPublic, string key, CacheGetOptions getOptions)
        {
            CacheKey   cacheKey = new CacheKey(key, isPublic);
            object     obj;
            CacheEntry cacheEntry = this.UpdateCache(cacheKey, null, false, CacheItemRemovedReason.Removed, out obj);

            if (cacheEntry == null)
            {
                return(null);
            }
            if ((getOptions & CacheGetOptions.ReturnCacheEntry) != CacheGetOptions.None)
            {
                return(cacheEntry);
            }
            return(cacheEntry.Value);
        }
Пример #5
0
 internal object Get(string key, CacheGetOptions getOptions);
Пример #6
0
 internal object Get(string key, CacheGetOptions getOptions)
 {
     return(this.DoGet(false, key, getOptions));
 }
Пример #7
0
        internal object DoGet(bool isPublic, string key, CacheGetOptions getOptions) {
            CacheEntry  entry;
            CacheKey    cacheKey;
            object      dummy;

            cacheKey = new CacheKey(key, isPublic);
            entry = UpdateCache(cacheKey, null, false, CacheItemRemovedReason.Removed, out dummy);
            if (entry != null) {
                if ((getOptions & CacheGetOptions.ReturnCacheEntry) != 0) {
                    return entry;
                }
                else {
                    return entry.Value;
                }
            }
            else {
                return null;
            }
        }
Пример #8
0
 internal object Get(string key, CacheGetOptions getOptions) {
     return DoGet(false, key, getOptions);
 }
Пример #9
0
 internal object Get(string key, CacheGetOptions getOptions) {
     return _cacheInternal.DoGet(true, key, getOptions);
 }
Пример #10
0
 public object Get(string key, CacheGetOptions getOptions)
 {
     throw new NotImplementedException();
 }
Пример #11
0
        private void LogGet(string key, object value, CacheGetOptions options)
        {
            string action = value == null ? "miss" : "hit";

            LogItem(action, options.Region, key, value);
        }
Пример #12
0
 public object Get(string key, CacheGetOptions getOptions)
 {
     throw new NotImplementedException();
 }
Пример #13
0
 /// <summary>
 /// Gets the object at the specified key from the cache, or null if the key does not exist.
 /// </summary>
 /// <param name="key"></param>
 /// <param name="options"></param>
 /// <returns></returns>
 public object Get(string key, CacheGetOptions options)
 {
     return(_provider.Get(_cacheId, key, options));
 }
Пример #14
0
		/// <summary>
		/// Gets the object at the specified key from the cache, or null if the key does not exist.
		/// </summary>
		/// <param name="key"></param>
		/// <param name="options"></param>
		/// <returns></returns>
		public object Get(string key, CacheGetOptions options)
		{
			return _provider.Get(_cacheId, key, options);
		}
		public object Get(string key, CacheGetOptions options)
		{
			object value = _cacheClient.Get(key, options);
			LogGet(key, value, options);
			return value;
		}
		private void LogGet(string key, object value, CacheGetOptions options)
		{
			string action = value == null ? "miss" : "hit";
			LogItem(action, options != null ? options.Region : null, key, value);
		}
Пример #17
0
            public object Get(string key, CacheGetOptions options)
            {
                ValueOptionsPair value;

                return(_cache.TryGetValue(key, out value) ? value.Value : null);
            }
Пример #18
0
 internal object Get(string key, CacheGetOptions getOptions)
 {
     return(_cacheInternal.DoGet(true, key, getOptions));
 }