ObjectCache.GetCacheItem Method

.NET Framework 4.6 and 4.5

When overridden in a derived class, gets the specified cache entry from the cache as a CacheItem instance.

Namespace:  System.Runtime.Caching
Assembly:  System.Runtime.Caching (in System.Runtime.Caching.dll)

public abstract CacheItem GetCacheItem(
	string key,
	string regionName
)

Parameters

key
Type: System.String

A unique identifier for the cache entry to get.

regionName
Type: System.String

Optional. A named region in the cache to which the cache was added, if regions are implemented. Because regions are not implemented in .NET Framework 4, the default is null.

Return Value

Type: System.Runtime.Caching.CacheItem
The cache entry that is identified by key.

This method overload exists because some cache implementations might extend the CacheItem class. In that case, the Get(String, String) method overload will not necessarily return all the information about cached data. However, the GetCacheItem(String, String) method overload enables custom caches to return more than just the cache value.

The GetCacheItem(String, String) method is like the Get(String, String) method, except that the GetCacheItem(String, String) method returns return the cache entry as a CacheItem instance.

.NET Framework

Supported in: 4.6, 4.5, 4
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft