Export (0) Print
Expand All

DataCache Class

The object that is used by cache-enabled applications for storing and retrieving objects from the cache. An instance of this object is referred to as the cache client.

System..::..Object
  Microsoft.ApplicationServer.Caching..::..DataCache

Namespace:  Microsoft.ApplicationServer.Caching
Assembly:  Microsoft.ApplicationServer.Caching.Client (in Microsoft.ApplicationServer.Caching.Client.dll)

public sealed class DataCache

The DataCache type exposes the following members.

  NameDescription
Public methodDataCache()()()()Creates a DataCache that accesses the "default" cache; uses settings in the "default" cache client configuration.
Public methodDataCache(String)Creates a DataCache that accesses the specified cache name; uses settings in the "default" cache client configuration.
Public methodDataCache(String, String)Creates a DataCache that accesses the specified cache name; uses settings in the named cache client configuration.
Top

  NameDescription
Public propertyItemAllows for the use of array notation to access cached objects.
Public propertyNameThe name of the cache associated with the DataCache object.
Top

  NameDescription
Public methodAdd(String, Object)Adds an object to the cache.
Public methodAdd(String, Object, IEnumerable<(Of <<'(DataCacheTag>)>>))Adds an object to the cache. This method enables associating tags with the cached object. This overload is not supported in Windows Azure Shared Caching.
Public methodAdd(String, Object, String)Adds an object to a region in the cache. This overload is not supported in Windows Azure Shared Caching.
Public methodAdd(String, Object, TimeSpan)Adds an object to the cache. This method provides the ability to specify when the object should be expired.
Public methodAdd(String, Object, IEnumerable<(Of <<'(DataCacheTag>)>>), String)Adds an object to a region in the cache. This method enables association of tags with objects in the cache. This overload is not supported in Windows Azure Shared Caching.
Public methodAdd(String, Object, TimeSpan, IEnumerable<(Of <<'(DataCacheTag>)>>))Adds an object to the cache. This method enables associating tags with the cached object and specifying when the object should be expired. This overload is not supported in Windows Azure Shared Caching.
Public methodAdd(String, Object, TimeSpan, String)Adds an object to a region in the cache. This method provides the ability to specify when the object should be expired. This overload is not supported in Windows Azure Shared Caching.
Public methodAdd(String, Object, TimeSpan, IEnumerable<(Of <<'(DataCacheTag>)>>), String)Adds an object to a region in the cache. This method enables associating tags with the cached object and specifying when the object should be expired. This overload is not supported in Windows Azure Shared Caching.
Public methodAddCacheLevelBulkCallbackAdds a bulk cache notification callback for cache operations occurring on all regions and items. Not supported in Windows Azure Shared Caching.
Public methodAddCacheLevelCallbackAdds a cache notification callback for cache operations occurring on all regions and items. Not supported in Windows Azure Shared Caching.
Public methodAddFailureNotificationCallbackAdds a failure notification callback, for notifications indicating that a client has missed one or more cache notifications. Not supported in Windows Azure Shared Caching.
Public methodAddItemLevelCallback(String, DataCacheOperations, DataCacheNotificationCallback)Adds a cache notification callback for cache operations occurring on one specific item that is not stored in a region. Not supported in Windows Azure Shared Caching.
Public methodAddItemLevelCallback(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.
Public methodAddRegionLevelCallbackAdds a cache notification callback for cache operations occurring on one specific region. Not supported in Windows Azure Shared Caching.
Public methodAppend(String, String)Concatenates a string to a string object stored in the cache.
Public methodAppend(String, String, String)Concatenates a string to a string object stored in the cache in the specified region.
Public methodBulkGet(IEnumerable<(Of <<'(String>)>>))Gets all of the objects associated with the specified keys across all system regions. This method does not search user-defined regions.
Public methodBulkGet(IEnumerable<(Of <<'(String>)>>), String)Returns objects for the specified keys from the specified region of the cache. Not supported in Windows Azure Shared Caching.
Public methodClearRemoves all objects from the cache associated with the DataCache object.
Public methodClearRegionDeletes all objects in the specified region. Not supported in Windows Azure Shared Caching.
Public methodCreateRegionCreates a region. Not supported in Windows Azure Shared Caching.
Public methodDecrement(String, Int64, Int64)Decrements a long value stored in the cache.
Public methodDecrement(String, Int64, Int64, String)Decrements a long value stored in the cache in the specified region.
Public methodEquals (Inherited from Object.)
Public methodGet(String)Gets an object from the cache using the specified key.
Public methodGet(String, DataCacheItemVersion%)Gets an object from the cache using the specified key. You may also provide the version to obtain a specific version of a key, if that version is still the most current in the cache.
Public methodGet(String, String)Gets an object from the specified region by using the specified key. This overload is not supported in Windows Azure Shared Caching.
Public methodGet(String, DataCacheItemVersion%, String)Gets an object from the specified region by using the specified key. You may also provide the version to obtain the specific version of a key, if that version is still the most current in the region. This overload is not supported in Windows Azure Shared Caching.
Public methodGetAndLock(String, TimeSpan, DataCacheLockHandle%)Locks the key if the key is present and it is not locked and returns the object corresponding to the key.
Public methodGetAndLock(String, TimeSpan, DataCacheLockHandle%, Boolean)Lock the key if key is present and it is not locked by any clients and returns the object corresponding to the key.
Public methodGetAndLock(String, TimeSpan, DataCacheLockHandle%, String)Locks the key if the key is present and is not locked and returns the object corresponding to the key. For objects stored in regions. This overload is not supported in Windows Azure Shared Caching.
Public methodGetAndLock(String, TimeSpan, DataCacheLockHandle%, String, Boolean)Lock the key if key is present and it is not locked by any clients and returns the object corresponding to the key. For objects stored in regions. This overload is not supported in Windows Azure Shared Caching.
Public methodGetCacheItem(String)Gets a DataCacheItem object to retrieve all information associated with your cached object in the cluster.
Public methodGetCacheItem(String, String)Gets a DataCacheItem object to retrieve all information associated with your cached object in the cluster. For objects stored in regions. This overload is not supported in Windows Azure Shared Caching.
Public methodGetHashCode (Inherited from Object.)
Public methodGetIfNewer(String, DataCacheItemVersion%)Gets an object from the cache, but only if a newer version of the object resides in the cache.
Public methodGetIfNewer(String, DataCacheItemVersion%, String)Gets an object from the specified region, but only if a newer version of the object resides in the region. This overload is not supported in Windows Azure Shared Caching.
Public methodGetObjectsByAllTagsGets an enumerable list of all cached objects in the specified region that have all the same tags in common. Not supported in Windows Azure Shared Caching.
Public methodGetObjectsByAnyTagGets an enumerable list of all cached objects in the specified region that have any of the same tags in common. Not supported in Windows Azure Shared Caching.
Public methodGetObjectsByTagGets an enumerable list of all cached objects in the specified region that have the specified tag. Not supported in Windows Azure Shared Caching.
Public methodGetObjectsInRegionGets an enumerable list of all cached objects in the specified region. Not supported in Windows Azure Shared Caching.
Public methodGetSystemRegionNameReturns the system region name for the specified key. Not supported in Windows Azure Shared Caching.
Public methodGetSystemRegionsUsed to determine the default regions for the cache. Not supported in Windows Azure Shared Caching.
Public methodGetType (Inherited from Object.)
Public methodIncrement(String, Int64, Int64)Increments a long value stored in the cache.
Public methodIncrement(String, Int64, Int64, String)Increments a long value stored in the cache in the specified region.
Public methodPrepend(String, String)Prepends a string to a string object stored in the cache.
Public methodPrepend(String, String, String)Prepends a string to a string object stored in the cache in the specified region.
Public methodPut(String, Object)Adds or replaces an object in the cache.
Public methodPut(String, Object, DataCacheItemVersion)Adds or replaces an object in the cache if it is at the specified version.
Public methodPut(String, Object, IEnumerable<(Of <<'(DataCacheTag>)>>))Adds or replaces an object in the cache. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching.
Public methodPut(String, Object, String)Adds or replaces an object in the specified region. This overload is not supported in Windows Azure Shared Caching.
Public methodPut(String, Object, TimeSpan)Adds or replaces an object in the cache. Specifies the timeout value of the cached object.
Public methodPut(String, Object, DataCacheItemVersion, IEnumerable<(Of <<'(DataCacheTag>)>>))Adds or replaces an object in the cache if it is at the specified version. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching.
Public methodPut(String, Object, DataCacheItemVersion, String)Adds or replaces an object in the specified region if it is at the specified version. This overload is not supported in Windows Azure Shared Caching.
Public methodPut(String, Object, DataCacheItemVersion, TimeSpan)Adds or replaces an object in the cache if it is at the specified version. Specifies the timeout value of the cached object.
Public methodPut(String, Object, IEnumerable<(Of <<'(DataCacheTag>)>>), String)Adds or replaces an object in the specified region. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching.
Public methodPut(String, Object, TimeSpan, IEnumerable<(Of <<'(DataCacheTag>)>>))Adds or replaces an object in the cache. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching.
Public methodPut(String, Object, TimeSpan, String)Adds or replaces an object in the specified region. Specifies the timeout value of the cached object. This overload is not supported in Windows Azure Shared Caching.
Public methodPut(String, Object, DataCacheItemVersion, IEnumerable<(Of <<'(DataCacheTag>)>>), String)Adds or replaces an object in the specified region if it is at the specified version. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching.
Public methodPut(String, Object, DataCacheItemVersion, TimeSpan, IEnumerable<(Of <<'(DataCacheTag>)>>))Adds or replaces an object in the cache if it is at the specified version. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching.
Public methodPut(String, Object, DataCacheItemVersion, TimeSpan, String)Adds or replaces an object in the specified region if it is at the specified version. Specifies the timeout value of the cached object. This overload is not supported in Windows Azure Shared Caching.
Public methodPut(String, Object, TimeSpan, IEnumerable<(Of <<'(DataCacheTag>)>>), String)Adds or replaces an object in the specified region. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching.
Public methodPut(String, Object, DataCacheItemVersion, TimeSpan, IEnumerable<(Of <<'(DataCacheTag>)>>), String)Adds or replaces an object in the specified region if it is at the specified version. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching.
Public methodPutAndUnlock(String, Object, DataCacheLockHandle)Replaces and unlocks an object in the cache.
Public methodPutAndUnlock(String, Object, DataCacheLockHandle, IEnumerable<(Of <<'(DataCacheTag>)>>))Replaces and unlocks an object in the cache. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching.
Public methodPutAndUnlock(String, Object, DataCacheLockHandle, String)Replaces and unlocks an object in the specified region. This overload is not supported in Windows Azure Shared Caching.
Public methodPutAndUnlock(String, Object, DataCacheLockHandle, TimeSpan)Replaces and unlocks an object in the cache. Specifies the timeout value of the cached object.
Public methodPutAndUnlock(String, Object, DataCacheLockHandle, IEnumerable<(Of <<'(DataCacheTag>)>>), String)Replaces and unlocks an object in the specified region. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching.
Public methodPutAndUnlock(String, Object, DataCacheLockHandle, TimeSpan, IEnumerable<(Of <<'(DataCacheTag>)>>))Replaces and unlocks an object in the cache. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching.
Public methodPutAndUnlock(String, Object, DataCacheLockHandle, TimeSpan, String)Replaces and unlocks an object in the specified region. Specifies the timeout value of the cached object. This overload is not supported in Windows Azure Shared Caching.
Public methodPutAndUnlock(String, Object, DataCacheLockHandle, TimeSpan, IEnumerable<(Of <<'(DataCacheTag>)>>), String)Replaces and unlocks an object in the specified region. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching.
Public methodRemove(String)Removes an object from the cache.
Public methodRemove(String, DataCacheItemVersion)Removes an object with a specific version from the cache.
Public methodRemove(String, DataCacheLockHandle)Removes an object from the cache with an associated lock handle.
Public methodRemove(String, String)Removes an object from the cache in a region. This overload is not supported in Windows Azure Shared Caching.
Public methodRemove(String, DataCacheItemVersion, String)Removes an object with a specific version from the cache in a region. This overload is not supported in Windows Azure Shared Caching.
Public methodRemove(String, DataCacheLockHandle, String)Removes an object from the cache with an associated lock handle in a region. This overload is not supported in Windows Azure Shared Caching.
Public methodRemoveCallbackRemoves a cache notification callback. Not supported in Windows Azure Shared Caching.
Public methodRemoveRegionDeletes a region. All cached objects inside the region are also removed. Not supported in Windows Azure Shared Caching.
Public methodResetObjectTimeout(String, TimeSpan)Resets the object timeout value, defining how long objects reside in the cache before expiring. The value specified for the object overrides the default settings for the cache.
Public methodResetObjectTimeout(String, TimeSpan, String)Resets the object timeout value, defining how long objects reside in the region before expiring. The value specified for the object overrides the default settings for the cache.
Public methodToString (Inherited from Object.)
Public methodUnlock(String, DataCacheLockHandle)Releases objects locked in the cache. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object.
Public methodUnlock(String, DataCacheLockHandle, String)Releases objects locked in the specified region. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object. This overload is not supported in Windows Azure Shared Caching.
Public methodUnlock(String, DataCacheLockHandle, TimeSpan)Releases objects locked in the cache. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object. Specifies a new timeout value for the cached object.
Public methodUnlock(String, DataCacheLockHandle, TimeSpan, String)Releases objects locked in the specified region. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object. Specifies a new timeout value for the cached object. This overload is not supported in Windows Azure Shared Caching.
Top

  NameDescription
Public eventCacheOperationCompletedInfrastructure. Internal.
Public eventCacheOperationStartedInfrastructure. Internal.
Top

There are multiple options for cache clients, which are specified in the application configuration settings.

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

Community Additions

ADD
Show:
© 2014 Microsoft