Removing a Collection of Data from Cache
Just like atomic remove operation, RemoveBulk also removes all cached items in list and returns removed items. Here it is returned in the form of a dictionary. Following is a code example for remove bulk operation:
string[] keys = { "Product:1001", "Product:1002" };
try{
IDictionary removedItems = cache.RemoveBulk(keys);
foreach (DictionaryEntry entry in removedItems)
{
if (entry.Value is Product)
{
//do something
}
}
}
catch (OperationFailedException ex){
//handle exception
}