Removes the object from the Cache.

Namespace: Alachisoft.NCache.Web.Caching
Assembly: Alachisoft.NCache.Web (in Alachisoft.NCache.Web.dll) Version: 4.3.0.0 (4.3.0.0)

Syntax

C#
public virtual void Delete(
	string key
)
Visual Basic
Public Overridable Sub Delete ( 
	key As String
)
Visual C++
public:
virtual void Delete(
	String^ key
)

Parameters

key
Type: System..::..String
The cache key used to reference the item.

Remarks

Note: If exceptions are enabled through the ExceptionsEnabled setting, this property throws exception incase of failure.

Examples

The following example demonstrates how you can remove an item from your application's Cache object.
 Copy imageCopy
Cache cache = NCache.InitializeCache("myCache");
cache.Delete("timestamp");

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionkey contains a null reference (Nothing in Visual Basic).
System..::..ArgumentExceptionkey is not serializable.

See Also