• Facebook
  • Twitter
  • Youtube
  • LinkedIn
  • RSS
  • Docs
  • Comparisons
  • Blogs
  • Try NCache
  • Contact Us
Try NCache
Show / Hide Table of Contents

Method GetBulk

GetBulk<T>(IEnumerable<String>, ReadThruOptions)

Retrieves the objects from cache for the given keys as key-value pairs. Options regarding reading from data source (read-through) can be set.

Declaration
IDictionary<string, T> GetBulk<T>(IEnumerable<string> keys, ReadThruOptions readThruOptions = null)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.String> keys

The keys against which items are to be fetched from cache.

ReadThruOptions readThruOptions

ReadThruOptions to read from data source. These can be either ReadThru, ReadThruForced or none.

Returns
Type Description
System.Collections.Generic.IDictionary<System.String, T>

The retrieved cache items as key-value pairs.

Type Parameters
Name Description
T

Specifies the type of value obtained from the cache.

Examples

The following example demonstrates how to retrieve the value cached against multiple keys with ReadThruOptions.

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

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

ReadThruOptions readThruOptions = new ReadThruOptions(ReadMode.ReadThru);

IDictionary<string, Product> items = cache.GetBulk<Product>(keys, readThruOptions);
Exceptions
Type Condition
System.ArgumentNullException

Keys contain a null reference.

System.ArgumentException

Keys cannot be serialized.

Contact Us

PHONE

+1 214-619-2601   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Try NCache
Pricing
NCache Playground

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

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Terms of Use
  •  
  • Privacy Policy
  •  
  • Cookie Policy
© Copyright Alachisoft 2002 - . All rights reserved. NCache is a registered trademark of Diyatech Corp.
  • Facebook
  • Twitter
  • Youtube
  • LinkedIn
  • RSS