This documentation is archived and is not being maintained.

ObjectCache::Remove Method

When overridden in a derived class, removes the cache entry from the cache.

Namespace:  System.Runtime.Caching
Assembly:  System.Runtime.Caching (in System.Runtime.Caching.dll)

public:
virtual Object^ Remove(
	String^ key, 
	String^ regionName
) abstract

Parameters

key
Type: System::String
A unique identifier for the cache entry.
regionName
Type: System::String
Optional. A named region in the cache to which the cache entry was added, if regions are implemented. The default value for the optional parameter is nullptr.

Return Value

Type: System::Object
An object that represents the value of the removed cache entry that was specified by the key, or nullptr if the specified entry was not found.

If you override this method in a custom cache implementation, if there is a cache entry in the cache that corresponds to key, the value of the removed item should be returned. If nothing was removed from the cache, the method should return nullptr.

NoteNote

Some distributed cache implementations might not support the ability to return the value that was removed from the cache. This might be because the cache implementation does not support returning the value of a removed cache item. It might also be because marshaling the object as a return value is too expensive. In such cases, cache implementations can return nullptr.

.NET Framework

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: