Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

MemoryCache.Remove Method

Removes a cache entry from the cache.

Namespace:  System.Runtime.Caching
Assembly:  System.Runtime.Caching (in System.Runtime.Caching.dll)
'Declaration
Public Overrides Function Remove ( _
	key As String, _
	regionName As String _
) As Object

Parameters

key
Type: System.String

A unique identifier for the cache entry to remove.

regionName
Type: System.String

A named region in the cache to which a cache entry was added. Do not pass a value for this parameter. This parameter is Nothing by default, because the MemoryCache class does not implement regions.

Return Value

Type: System.Object
If the entry is found in the cache, the removed cache entry; otherwise, Nothing.
ExceptionCondition
NotSupportedException

regionName is not Nothing.

ArgumentNullException

key is Nothing.

If the entry specified by key exists in the cache, removing the item triggers any associated change monitors. If the removed item was associated with a CacheItemUpdateCallback object or a CacheItemRemovedCallback object, the reason passed to the callback is Removed.

.NET Framework

Supported in: 4.5.1, 4.5, 4

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft. All rights reserved.