Retrieves the specified item from the Cache object. If the object is read through the data source, put it in the cache. It accepts the CacheItemVersion by reference. If null is passed for CacheItemVersion, then the version of the object from the cache is returned. If non-null CacheItemVersion is passed, then object is returned from the cache only if that is the current version of the object in the cache.

Namespace: Alachisoft.NCache.Web.Caching
Assembly: Alachisoft.NCache.Web (in Alachisoft.NCache.Web.dll) Version: 4.3.0.0 (4.3.0.0)

Syntax

C#
public virtual CacheItem GetCacheItem(
	string key,
	string providerName,
	DSReadOption dsReadOption,
	ref CacheItemVersion version
)
Visual Basic
Public Overridable Function GetCacheItem ( 
	key As String,
	providerName As String,
	dsReadOption As DSReadOption,
	ByRef version As CacheItemVersion
) As CacheItem
Visual C++
public:
virtual CacheItem^ GetCacheItem(
	String^ key, 
	String^ providerName, 
	DSReadOption dsReadOption, 
	CacheItemVersion^% version
)

Parameters

key
Type: System..::..String
The identifier for the cache item to retrieve.
providerName
Type: System..::..String
A specific name for the data source
dsReadOption
Type: Alachisoft.NCache.Web.Caching..::..DSReadOption
Options regarding reading from data source.
version
Type: Alachisoft.NCache.Web.Caching..::..CacheItemVersion%
The version of the object.

Return Value

Type: CacheItem
The retrieved cache item, or a null reference (Nothing in Visual Basic) if the key is not found.

See Also