Remove Method (String, DataCacheItemVersion, String)

Removes an object with a specific version from the cache in a region. Applies only to the server versions of AppFabric.

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

public bool Remove(
	string key,
	DataCacheItemVersion version,
	string region
)

Parameters

key
Type: System..::..String
The unique value that is used to identify the object in the region.
version
Type: Microsoft.ApplicationServer.Caching..::..DataCacheItemVersion
The DataCacheItemVersion object that represents the version of the cached object that is to be removed.
region
Type: System..::..String
The name of the region the object resides in.

Return Value

Type: System..::..Boolean
True if the object is removed; otherwise, false.

This method supports optimistic concurrency by only removing the object having the DataCacheItemVersion value specified with the version parameter. If another process updates this object before the method call, the object is not removed.

For more information about how to use this method, see <maml:externalLink><maml:linkText>Remove an Object from a Cache</maml:linkText><maml:linkUri>http://go.microsoft.com/fwlink/?LinkID=214987</maml:linkUri></maml:externalLink>.

Show: