MemoryCache.Remove Method (String, CacheEntryRemovedReason, String)

 

Removes a cache entry from the cache using the reason.

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

public object Remove(
	string key,
	CacheEntryRemovedReason reason,
	string regionName = null
)

Parameters

key
Type: System.String

A unique identifier for the cache entry to remove.

reason
Type: System.Runtime.Caching.CacheEntryRemovedReason

The reason the item was removed.

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 null 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, null.

.NET Framework
Available since 4.7
Return to top
Show: