示例#1
0
        /// <summary>
        /// Whether an Element is stored in the cache in Memory, indicating a very low cost of retrieval.
        /// </summary>
        /// <param name="key">Element Key.</param>
        /// <returns>True if an element matching the key is found in memory.</returns>
        public bool IsElementInMemory(object key)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }

            this.CheckStatus();
            return(_memoryStore.ContainsKey(key));
        }
示例#2
0
        public override byte[] Get(StorageKey key)
        {
            var hash = CreateHash(key);

            if (_memory.ContainsKey(hash))
            {
                return(_memory.GetValue(hash));
            }

            if (_disk.ContainsKey(hash))
            {
                return(_disk.GetValue(hash));
            }

            return(null);
        }