DataCache.GetCacheItem Method (String)

Gets a DataCacheItem object to retrieve all information associated with your cached object in the cluster.

Namespace: Microsoft.ApplicationServer.Caching
Assembly: Microsoft.ApplicationServer.Caching.Client (in microsoft.applicationserver.caching.client.dll)

Usage

'Usage
Dim instance As DataCache
Dim key As String
Dim returnValue As DataCacheItem

returnValue = instance.GetCacheItem(key)

Syntax

'Declaration
Public Function GetCacheItem ( _
    key As String _
) As DataCacheItem
public DataCacheItem GetCacheItem (
    string key
)
public:
DataCacheItem^ GetCacheItem (
    String^ key
)
public DataCacheItem GetCacheItem (
    String key
)
public function GetCacheItem (
    key : String
) : DataCacheItem

Parameters

  • key
    The unique value that is used to identify the object in the cache.

Return Value

ADataCacheItem object that contains all information associated with your cached object. Null is returned if the key does not exist.

Remarks

A DataCacheItem object is useful for tag-based and concurrency operations because, together with other information, it includes the associated tags and current version information corresponding to your cached object. For more information about tag-based operations, see Tag-Based Methods. For more information about concurrency, see Concurrency Models and Concurrency Methods.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Visual Studio 2010 and later, .NET Framework 4

Target Platforms

Windows 7; Windows Server 2008 R2; Windows Server 2008 Service Pack 2; Windows Vista Service Pack 2

See Also

Reference

DataCache Class
DataCache Members
Microsoft.ApplicationServer.Caching Namespace

  ff425062(v=azure.10).md 2011-08-26