Method DeleteBulk
DeleteBulk(String[], DSWriteOption, String, DataSourceItemsRemovedCallback)
Removes the objects from the Cache.
Declaration
public override void DeleteBulk(string[] keys, DSWriteOption dsWriteOption, string providerName, DataSourceItemsRemovedCallback onDataSourceItemsRemovedCallback)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | keys | The cache keys used to reference the item. |
DSWriteOption | dsWriteOption | Options regarding updating data source |
System.String | providerName | |
DataSourceItemsRemovedCallback | onDataSourceItemsRemovedCallback | 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.
OnDataSourceItemsRemoved(IDictionary result)
{
...
}
Cache cache = NCache.InitializeCache("myCache");
string[] keys = new string[]{"myItem1", "myItem2"};
cache.DeleteBulk(keys, DSWriteOption.WriteBehind, "writeThruProvider", new DataSourceItemsRemovedCallback(OnDataSourceItemsRemoved));
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentException |
|
DeleteBulk(String[], DSWriteOption, DataSourceItemsRemovedCallback)
Removes the objects from the Cache.
Declaration
public override void DeleteBulk(string[] keys, DSWriteOption dsWriteOption, DataSourceItemsRemovedCallback onDataSourceItemsRemovedCallback)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | keys | The cache keys used to reference the item. |
DSWriteOption | dsWriteOption | Options regarding updating data source |
DataSourceItemsRemovedCallback | onDataSourceItemsRemovedCallback | 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.
OnDataSourceItemsRemoved(IDictionary result)
{
...
}
Cache cache = NCache.InitializeCache("myCache");
string[] keys = new string[]{"myItem1", "myItem2"};
cache.DeleteBulk(keys, DSWriteOption.WriteBehind, new DataSourceItemsRemovedCallback(OnDataSourceItemsRemoved));
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentException |
|