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.
Namespace: Microsoft.ApplicationServer.Caching
Assembly: Microsoft.ApplicationServer.Caching.Client (in Microsoft.ApplicationServer.Caching.Client.dll)
Inheritance Hierarchy
System.Object
Microsoft.ApplicationServer.Caching.DataCache
Syntax
public sealed class DataCache
public ref class DataCache sealed
[<Sealed>]
type DataCache = class end
Public NotInheritable Class DataCache
Constructors
Name | Description | |
---|---|---|
DataCache() | Creates a DataCache that accesses the "default" cache; uses settings in the "default" cache client configuration. |
|
DataCache(String) | Creates a DataCache that accesses the specified cache name; uses settings in the "default" cache client configuration. |
|
DataCache(String, String) | Creates a DataCache that accesses the specified cache name; uses settings in the named cache client configuration. |
Properties
Name | Description | |
---|---|---|
Item[String] | Allows for the use of array notation to access cached objects. |
|
Name | The name of the cache associated with the DataCache object. |
Methods
Name | Description | |
---|---|---|
Add(String, Object) | Adds an object to the cache. |
|
Add(String, Object, IEnumerable<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. |
|
Add(String, Object, IEnumerable<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. |
|
Add(String, Object, String) | Adds an object to a region in the cache. This overload is not supported in Windows Azure Shared Caching. |
|
Add(String, Object, TimeSpan) | Adds an object to the cache. This method provides the ability to specify when the object should be expired. |
|
Add(String, Object, TimeSpan, IEnumerable<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. |
|
Add(String, Object, TimeSpan, IEnumerable<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. |
|
Add(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. |
|
AddCacheLevelBulkCallback(DataCacheBulkNotificationCallback) | Adds a bulk cache notification callback for cache operations occurring on all regions and items. Not supported in Windows Azure Shared Caching. |
|
AddCacheLevelCallback(DataCacheOperations, DataCacheNotificationCallback) | Adds a cache notification callback for cache operations occurring on all regions and items. Not supported in Windows Azure Shared Caching. |
|
AddFailureNotificationCallback(DataCacheFailureNotificationCallback) | Adds a failure notification callback, for notifications indicating that a client has missed one or more cache notifications. Not supported in Windows Azure Shared Caching. |
|
AddItemLevelCallback(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. |
|
AddItemLevelCallback(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. |
|
AddRegionLevelCallback(String, DataCacheOperations, DataCacheNotificationCallback) | Adds a cache notification callback for cache operations occurring on one specific region. Not supported in Windows Azure Shared Caching. |
|
Append(String, String) | Concatenates a string to a string object stored in the cache. |
|
Append(String, String, String) | Concatenates a string to a string object stored in the cache in the specified region. |
|
BulkGet(IEnumerable<String>) | Gets all of the objects associated with the specified keys across all system regions. This method does not search user-defined regions. |
|
BulkGet(IEnumerable<String>, String) | Returns objects for the specified keys from the specified region of the cache. Not supported in Windows Azure Shared Caching. |
|
Clear() | Removes all objects from the cache associated with the DataCache object. |
|
ClearRegion(String) | Deletes all objects in the specified region. Not supported in Windows Azure Shared Caching. |
|
CreateRegion(String) | Creates a region. Not supported in Windows Azure Shared Caching. |
|
Decrement(String, Int64, Int64) | Decrements a long value stored in the cache. |
|
Decrement(String, Int64, Int64, String) | Decrements a long value stored in the cache in the specified region. |
|
Equals(Object) | (Inherited from Object.) |
|
Get(String) | Gets an object from the cache using the specified key. |
|
Get(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. |
|
Get(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. |
|
Get(String, String) | Gets an object from the specified region by using the specified key. This overload is not supported in Windows Azure Shared Caching. |
|
GetAndLock(String, TimeSpan, DataCacheLockHandle) | Locks the key if the key is present and it is not locked and returns the object corresponding to the key. |
|
GetAndLock(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. |
|
GetAndLock(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. |
|
GetAndLock(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. |
|
GetCacheItem(String) | Gets a DataCacheItem object to retrieve all information associated with your cached object in the cluster. |
|
GetCacheItem(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. |
|
GetHashCode() | (Inherited from Object.) |
|
GetIfNewer(String, DataCacheItemVersion) | Gets an object from the cache, but only if a newer version of the object resides in the cache. |
|
GetIfNewer(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. |
|
GetObjectsByAllTags(IEnumerable<DataCacheTag>, String) | Gets 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. |
|
GetObjectsByAnyTag(IEnumerable<DataCacheTag>, String) | Gets 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. |
|
GetObjectsByTag(DataCacheTag, String) | Gets an enumerable list of all cached objects in the specified region that have the specified tag. Not supported in Windows Azure Shared Caching. |
|
GetObjectsInRegion(String) | Gets an enumerable list of all cached objects in the specified region. Not supported in Windows Azure Shared Caching. |
|
GetSystemRegionName(String) | Returns the system region name for the specified key. Not supported in Windows Azure Shared Caching. |
|
GetSystemRegions() | Used to determine the default regions for the cache. Not supported in Windows Azure Shared Caching. |
|
GetType() | (Inherited from Object.) |
|
Increment(String, Int64, Int64) | Increments a long value stored in the cache. |
|
Increment(String, Int64, Int64, String) | Increments a long value stored in the cache in the specified region. |
|
Prepend(String, String) | Prepends a string to a string object stored in the cache. |
|
Prepend(String, String, String) | Prepends a string to a string object stored in the cache in the specified region. |
|
Put(String, Object) | Adds or replaces an object in the cache. |
|
Put(String, Object, DataCacheItemVersion) | Adds or replaces an object in the cache if it is at the specified version. |
|
Put(String, Object, DataCacheItemVersion, IEnumerable<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. |
|
Put(String, Object, DataCacheItemVersion, IEnumerable<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. |
|
Put(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. |
|
Put(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. |
|
Put(String, Object, DataCacheItemVersion, TimeSpan, IEnumerable<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. |
|
Put(String, Object, DataCacheItemVersion, TimeSpan, IEnumerable<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. |
|
Put(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. |
|
Put(String, Object, IEnumerable<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. |
|
Put(String, Object, IEnumerable<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. |
|
Put(String, Object, String) | Adds or replaces an object in the specified region. This overload is not supported in Windows Azure Shared Caching. |
|
Put(String, Object, TimeSpan) | Adds or replaces an object in the cache. Specifies the timeout value of the cached object. |
|
Put(String, Object, TimeSpan, IEnumerable<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. |
|
Put(String, Object, TimeSpan, IEnumerable<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. |
|
Put(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. |
|
PutAndUnlock(String, Object, DataCacheLockHandle) | Replaces and unlocks an object in the cache. |
|
PutAndUnlock(String, Object, DataCacheLockHandle, IEnumerable<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. |
|
PutAndUnlock(String, Object, DataCacheLockHandle, IEnumerable<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. |
|
PutAndUnlock(String, Object, DataCacheLockHandle, String) | Replaces and unlocks an object in the specified region. This overload is not supported in Windows Azure Shared Caching. |
|
PutAndUnlock(String, Object, DataCacheLockHandle, TimeSpan) | Replaces and unlocks an object in the cache. Specifies the timeout value of the cached object. |
|
PutAndUnlock(String, Object, DataCacheLockHandle, TimeSpan, IEnumerable<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. |
|
PutAndUnlock(String, Object, DataCacheLockHandle, TimeSpan, IEnumerable<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. |
|
PutAndUnlock(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. |
|
Remove(String) | Removes an object from the cache. |
|
Remove(String, DataCacheItemVersion) | Removes an object with a specific version from the cache. |
|
Remove(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. |
|
Remove(String, DataCacheLockHandle) | Removes an object from the cache with an associated lock handle. |
|
Remove(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. |
|
Remove(String, String) | Removes an object from the cache in a region. This overload is not supported in Windows Azure Shared Caching. |
|
RemoveCallback(DataCacheNotificationDescriptor) | Removes a cache notification callback. Not supported in Windows Azure Shared Caching. |
|
RemoveRegion(String) | Deletes a region. All cached objects inside the region are also removed. Not supported in Windows Azure Shared Caching. |
|
ResetObjectTimeout(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. |
|
ResetObjectTimeout(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. |
|
ToString() | (Inherited from Object.) |
|
Unlock(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. |
|
Unlock(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. |
|
Unlock(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. |
|
Unlock(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. |
Events
Name | Description | |
---|---|---|
CacheOperationCompleted | This API supports the product infrastructure and is not intended to be used directly from your code. Internal. |
|
CacheOperationStarted | This API supports the product infrastructure and is not intended to be used directly from your code. Internal. |
Remarks
There are multiple options for cache clients, which are specified in the application configuration settings.
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.
See Also
Microsoft.ApplicationServer.Caching Namespace
Return to top