Esempio n. 1
0
        /// <summary>
        /// Removes the specified cache index.
        /// </summary>
        /// <param name="cacheIndex">Index of the cache.</param>
        public static void Remove(CacheIndex cacheIndex)
        {
            if (cacheIndex == null)
            {
                throw new ArgumentNullException("cacheIndex", "Requested CacheIndex is null");
            }

            string key = CacheIndexMap.GetKey(cacheIndex);

            CacheIndexMap.Remove(key);
        }
Esempio n. 2
0
        /// <summary>
        /// Updates the specified cache index.
        /// </summary>
        /// <param name="cacheIndex">Index of the cache.</param>
        public static void Update(CacheIndex cacheIndex)
        {
            if (cacheIndex == null)
            {
                throw new ArgumentNullException("cacheIndex");
            }

            string key = CacheIndexMap.GetKey(cacheIndex);

            // if the key exists in the map then replace it with current parameter..
            if (Map.ContainsKey(key))
            {
                CacheIndexMap.Remove(key);
            }

            CacheIndexMap.Add(cacheIndex);
        }