• Webinars
  • Docs
  • Download
  • Blogs
  • Contact Us
Try Free
Show / Hide Table of Contents

Method Remove

Remove(ICollection<TKey>)

Removes the element with the specified keys from IDistributedDictionary.

Declaration
int Remove(ICollection<TKey> keys)
Parameters
Type Name Description
System.Collections.Generic.ICollection<TKey> keys

The keys of the elements to remove.

Returns
Type Description
System.Int32

The number of items that were removed.

Examples

The following code sample shows how to remove multiple entries in distributed dictionary.

 ICache cache = CacheManager.GetCache("demoCache");
string dataTypeName = "DistributedDictionary";

IDistributedDictionary<string, Product> dictionary = cache.DataTypeManager.GetDictionary<string, Product>(dataTypeName);

// Create list of keys to remove
List<string> keysToRemove = FetchExpiredProducts();

int itemsRemoved = dictionary.Remove(keysToRemove);
Back to top Copyright © 2017 Alachisoft