Try Playground
Show / Hide Table of Contents

Method RemoveBulk

RemoveBulk(IEnumerable<String>, WriteThruOptions)

Removes the specified items from the ICache. You can also specify the write option such that the items may be removed from both cache and data source.

Declaration
void RemoveBulk(IEnumerable<string> keys, WriteThruOptions writeThruOptions = null)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.String> keys

List of unique keys to reference the items.

WriteThruOptions writeThruOptions

WriteThruOptions regarding updating the data source. This can be either WriteThru, WriteBehind or none.

Examples

The following example demonstrates how you can remove an item from your application's ICache object.

ICache cache = CacheManager.GetCache("demoClusteredCache");

List<string> keys = new List<string>()
{
    "Product0",
    "Product1",
    "Product2"
};

WriteThruOptions writeThruOptions = new WriteThruOptions(WriteMode.WriteThru, "ProdDataSource1");

cache.RemoveBulk(keys, writeThruOptions);
Exceptions
Type Condition
System.ArgumentNullException

Keys contain a null reference.

System.ArgumentException

Keys are not serializable.

RemoveBulk<T>(IEnumerable<String>, out IDictionary<String, T>, WriteThruOptions)

Removes the specified items from the Alachisoft.NCache.Client.Cache and returns them to the application in the form of a dictionary as an out Parameter.

Declaration
void RemoveBulk<T>(IEnumerable<string> keys, out IDictionary<string, T> removedItems, WriteThruOptions writeThruOptions = null)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.String> keys

List of unique keys to reference the items.

System.Collections.Generic.IDictionary<System.String, T> removedItems

out Parameter through which the removed items from the cache are returned.

WriteThruOptions writeThruOptions

WriteThruOptions regarding updating the data source. This can be either WriteThru, WriteBehind or none.

Type Parameters
Name Description
T

Specifies the type of value obtained from the cache.

Remarks

RemovedItems dictionary contains the key and value of the items that were successfully removed from the cache.

Examples

The following example demonstrates how you can remove multiple of items from your application's ICache object.

ICache cache = CacheManager.GetCache("demoClusteredCache");

List<string> keys = new List<string>()
{
    "Product0",
    "Product1",
    "Product2"
};

WriteThruOptions writeThruOptions = new WriteThruOptions(WriteMode.WriteThru, "ProdDataSource1");

IDictionary<string, Product> products = null;
cache.RemoveBulk<Product>(keys,out products);
Exceptions
Type Condition
System.ArgumentNullException

keys contains a null reference.

System.ArgumentException

keys is not serializable.

In This Article
  • RemoveBulk(IEnumerable<String>, WriteThruOptions)
  • RemoveBulk<T>(IEnumerable<String>, out IDictionary<String, T>, WriteThruOptions)

Contact Us

PHONE

+1 (214) 764-6933   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Professional
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
� Copyright Alachisoft 2002 - 2025. All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top