RemoveItem() public static method

Removes an item matching the given key from the cache.
public static RemoveItem ( string key, string regionName = null ) : bool
key string /// A unique identifier for the cache entry. ///
regionName string /// Optional. A named region in the cache to which the cache entry can be added, /// if regions are implemented. The default value for the optional parameter /// is null. ///
return bool
示例#1
0
        /// <summary>
        /// Removes the value associated with the specified key.
        /// </summary>
        /// <param name="cachedPath">
        /// The key of the item to remove.
        /// </param>
        /// <returns>
        /// true if the <see cref="CacheIndexer"/> removes an element with
        /// the specified key; otherwise, false.
        /// </returns>
        public static bool Remove(string cachedPath)
        {
            string key = Path.GetFileNameWithoutExtension(cachedPath);

            return(MemCache.RemoveItem(key));
        }