コード例 #1
0
        /// <summary>
        /// Looks for an item in the cache and returns the bytes for that item
        /// </summary>
        /// <param name="key">The cache key of the item</param>
        /// <returns>The bytes for the cached item or null if the item is not found in the cache</returns>
        public byte[] Lookup(string key)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }
            var cacheEntry = GetEntry(key);

            if (cacheEntry == null)
            {
                return(null);
            }
            CacheEvictionPolicy.NotifyLookup(key);
            return(cacheEntry.GetBytes());
        }