Get the cache item stored in 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#
[ObsoleteAttribute("Use GetCacheItem(string key, string group, string subGroup, DSReadOption dsReadOption)")]
public virtual CacheItem GetCacheItem(
	string key,
	string group,
	string subGroup
)
Visual Basic
<ObsoleteAttribute("Use GetCacheItem(string key, string group, string subGroup, DSReadOption dsReadOption)")> 
Public Overridable Function GetCacheItem ( 
	key As String,
	group As String,
	subGroup As String
) As CacheItem
Visual C++
public:
[ObsoleteAttribute(L"Use GetCacheItem(string key, string group, string subGroup, DSReadOption dsReadOption)")]
virtual CacheItem^ GetCacheItem(
	String^ key, 
	String^ group, 
	String^ subGroup
)

Parameters

key
Type: System..::..String
Key used to reference the desired object
group
Type: System..::..String
The group of the cache item. Items with the same group are logically grouped together.
subGroup
Type: System..::..String
The sub-group within a group.

Return Value

Type: CacheItem
CacheItem

Remarks

Note: If exceptions are enabled through the ExceptionsEnabled setting, this property throws exception incase of failure.

Examples

The following example demonstrates how to retrieve the value cached for an ASP.NET text box server control.
 Copy imageCopy
Cache cache = NCache.InitializeCache("myCache");
CacheItem item = cache.GetCacheItem(key, "group-name", "subgroup-name");

See Also