NCache 4.6 - Online Documentation

Delete an Item with Item Version

 
A delete method is a basic method which deletes the key from cache. If the item version is different from the one in cache or if the key does not exist, an OperationFailedException will be thrown by NCache.
 
      To utilize the API, include the following namespace in your application: Alachisoft.NCache.Web.Caching.
 
            //precondition: itemVersion is saved when item was added or inserted in cache
            string key = "Product:1001";
            try
            {
                //saved itemVersion from add or insert item call
                cache.Delete(key, itemVersion);
            }
            catch (OperationFailedException ex)
            {
                // handle exception
            }
 
 
See Also