NCache 4.6 - Online Documentation

Removing Collection 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:
 
      To utilize the API in NCache, include the following namespace in your application: Alachisoft.NCache.Web.Caching.
 
        string[] keys = { "Product:1001", "Product:1002" };
        try
        {
            IDictionary removedItems = cache.RemoveBulk(keys, DSWriteOption.None, null);
 
            foreach (DictionaryEntry entry in removedItems)
            {
                if (entry.Value is Product)
                {
                    //do something
                }
            }
        }
        catch (OperationFailedException ex)
        {
            //handle exception
        }
 
 
See Also