Removes the objects 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 override void DeleteBulk(
	string[] keys,
	DSWriteOption dsWriteOption,
	string providerName,
	DataSourceItemsRemovedCallback onDataSourceItemsRemovedCallback
)
Visual Basic
Public Overrides Sub DeleteBulk ( 
	keys As String(),
	dsWriteOption As DSWriteOption,
	providerName As String,
	onDataSourceItemsRemovedCallback As DataSourceItemsRemovedCallback
)
Visual C++
public:
virtual void DeleteBulk(
	array<String^>^ keys, 
	DSWriteOption dsWriteOption, 
	String^ providerName, 
	DataSourceItemsRemovedCallback^ onDataSourceItemsRemovedCallback
) override

Parameters

keys
Type: array<System..::..String>[]()[][]
The cache keys used to reference the item.
dsWriteOption
Type: Alachisoft.NCache.Web.Caching..::..DSWriteOption
Options regarding updating data source
providerName
Type: System..::..String
onDataSourceItemsRemovedCallback
Type: Alachisoft.NCache.Web.Caching..::..DataSourceItemsRemovedCallback
A delegate that, if provided, is called when item is removed from data source.

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
OnDataSourceItemsRemoved(IDictionary result)
{
...
}
Cache cache = NCache.InitializeCache("myCache");
string[] keys = new string[]{"myItem1", "myItem2"};
cache.DeleteBulk(keys, DSWriteOption.WriteBehind, "writeThruProvider", new DataSourceItemsRemovedCallback(OnDataSourceItemsRemoved));

Exceptions

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

See Also