Method Delete
Delete(String, CacheItemVersion)
Declaration
public override void Delete(string key, CacheItemVersion version)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | |
CacheItemVersion | version |
Overrides
Delete(String, DSWriteOption, DataSourceItemsRemovedCallback)
Removes the object from the Cache.
Declaration
public override void Delete(string key, DSWriteOption dsWriteOption, DataSourceItemsRemovedCallback onDataSourceItemRemovedCallback)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The cache key used to reference the item. |
DSWriteOption | dsWriteOption | Options regarding updating the data source. |
DataSourceItemsRemovedCallback | onDataSourceItemRemovedCallback | A delegate that, if provided, is called when item is removed from data source. |
Overrides
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.
Cache cache = NCache.InitializeCache("myCache");
cache.Remove("timestamp", DSWriteOption.None, new DataSourceItemsRemovedCallback(OnDataSourceItemsRemoved));
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentException |
|
Delete(String, DSWriteOption, String, DataSourceItemsRemovedCallback)
Declaration
public override void Delete(string key, DSWriteOption dsWriteOption, string providerName, DataSourceItemsRemovedCallback onDataSourceItemRemovedCallback)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | |
DSWriteOption | dsWriteOption | |
System.String | providerName | |
DataSourceItemsRemovedCallback | onDataSourceItemRemovedCallback |
Overrides
Delete(String, LockHandle)
Declaration
public override void Delete(string key, LockHandle lockHandle)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | |
LockHandle | lockHandle |