SALES: 1-800-867-1380
This topic has not yet been rated - Rate this topic

AddItemLevelCallback Method (String, DataCacheOperations, DataCacheNotificationCallback, String)

Adds a cache notification callback for cache operations occurring on one specific item that is stored in region. Not supported in Windows Azure Shared Caching.

Namespace:  Microsoft.ApplicationServer.Caching
Assembly:  Microsoft.ApplicationServer.Caching.Client (in Microsoft.ApplicationServer.Caching.Client.dll)
'Declaration
Public Function AddItemLevelCallback ( _
	key As String, _
	filter As DataCacheOperations, _
	clientCallback As DataCacheNotificationCallback, _
	region As String _
) As DataCacheNotificationDescriptor
'Usage
Dim instance As DataCache
Dim key As String
Dim filter As DataCacheOperations
Dim clientCallback As DataCacheNotificationCallback
Dim region As String
Dim returnValue As DataCacheNotificationDescriptor

returnValue = instance.AddItemLevelCallback(key, _
	filter, clientCallback, region)

Parameters

key
Type: System..::..String
The key used to store the object in the cache.
filter
Type: Microsoft.ApplicationServer.Caching..::..DataCacheOperations
The type of cache operation(s) that will trigger cache notifications.
clientCallback
Type: Microsoft.ApplicationServer.Caching..::..DataCacheNotificationCallback
The name of the method you want to invoke when these notifications occur.
region
Type: System..::..String
The name of the region where the object is stored.

Return Value

Type: Microsoft.ApplicationServer.Caching..::..DataCacheNotificationDescriptor
A DataCacheNotificationDescriptor object used to identify the cache notification callback.

Only item operations AddItem, ReplaceItem, and RemoveItem can trigger cache notifications with item-level callbacks. Specifying region operations in the filter parameter will cause an exception.

Use the DataCacheOperations enumeration in the filter parameter to specify what type of item operations you want to trigger cache notifications. Select more than one enumeration by separating the enumerations with the binary OR operator to perform a bitwise OR. To do this, use the | character in C#, and the Or operator in Visual Basic.

The clientCallback method you invoke with the cache notification must accept the same parameters as the DataCacheNotificationCallback delegate.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.