C# Class ImageProcessor.Web.Caching.MemCache

Encapsulates methods that allow the caching and retrieval of objects from the in memory cache.
显示文件 Open project: JimBobSquarePants/ImageProcessor Class Usage Examples

Public Methods

Method Description
AddItem ( string key, object value, System.Runtime.Caching.CacheItemPolicy policy = null, string regionName = null ) : bool

Adds an item to the cache.

Clear ( string regionName = null ) : bool

Clears the cache.

GetItem ( string key, string regionName = null ) : object

Fetches an item matching the given key from the cache.

RemoveItem ( string key, string regionName = null ) : bool

Removes an item matching the given key from the cache.

UpdateItem ( string key, object value, System.Runtime.Caching.CacheItemPolicy policy = null, string regionName = null ) : bool

Updates an item to the cache.

Method Details

AddItem() public static method

Adds an item to the cache.
public static AddItem ( string key, object value, System.Runtime.Caching.CacheItemPolicy policy = null, string regionName = null ) : bool
key string /// A unique identifier for the cache entry. ///
value object /// The object to insert. ///
policy System.Runtime.Caching.CacheItemPolicy /// Optional. An object that contains eviction details for the cache entry. This object /// provides more options for eviction than a simple absolute expiration. The default value for the optional parameter /// is null. ///
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

Clear() public static method

Clears the cache.
public static Clear ( string regionName = null ) : bool
regionName string /// The region name. ///
return bool

GetItem() public static method

Fetches an item matching the given key from the cache.
public static GetItem ( string key, string regionName = null ) : object
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 object

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

UpdateItem() public static method

Updates an item to the cache.
public static UpdateItem ( string key, object value, System.Runtime.Caching.CacheItemPolicy policy = null, string regionName = null ) : bool
key string /// A unique identifier for the cache entry. ///
value object /// The object to insert. ///
policy System.Runtime.Caching.CacheItemPolicy /// Optional. An object that contains eviction details for the cache entry. This object /// provides more options for eviction than a simple absolute expiration. The default value for the optional parameter /// is null. ///
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