Removes the objects from the Cache.
Namespace: Alachisoft.NCache.Web.CachingAssembly: Alachisoft.NCache.Web (in Alachisoft.NCache.Web.dll) Version: 4.1.0.0 (4.1.0.0)
Syntax
C# |
---|
public virtual IDictionary RemoveBulk( string[] keys, DSWriteOption dsWriteOption, DataSourceItemsRemovedCallback onDataSourceItemsRemovedCallback ) |
Visual Basic |
---|
Public Overridable Function RemoveBulk ( _ keys As String(), _ dsWriteOption As DSWriteOption, _ onDataSourceItemsRemovedCallback As DataSourceItemsRemovedCallback _ ) As IDictionary |
Visual C++ |
---|
public: virtual IDictionary^ RemoveBulk( array<String^>^ keys, DSWriteOption dsWriteOption, DataSourceItemsRemovedCallback^ onDataSourceItemsRemovedCallback ) |
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
- onDataSourceItemsRemovedCallback
- Type: Alachisoft.NCache.Web.Caching..::..DataSourceItemsRemovedCallback
A delegate that, if provided, is called when item is removed from data source.
Return Value
The items removed from the Cache. If the value in the keys parameter is not found, returns a null reference (Nothing in Visual Basic).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.
CopyC#
OnDataSourceItemsRemoved(IDictionary result) { ... } Cache cache = NCache.InitializeCache("myCache"); string[] keys = new string[]{"myItem1", "myItem2"}; cache.Remove(keys, DSWriteOption.WriteBehind, new DataSourceItemsRemovedCallback(OnDataSourceItemsRemoved), "group-name", "subGroup-name");
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | keys contains a null reference (Nothing in Visual Basic). |
System..::..ArgumentException | keys is not serializable. |