• Products
  • Solutions
  • Customers
  • Resources
  • Company
  • Pricing
  • Download
Try Playground
Show / Hide Table of Contents

Method FromCache

FromCache<T>(IQueryable<T>, CachingOptions)

Checks if the result set is available in cache or not. If it is available it is fetched from the cache and returned however if it is not available the query is executed on the database and the result set is stored in cache as well as returned.

Declaration
public static IEnumerable<T> FromCache<T>(this IQueryable<T> query, CachingOptions options)
    where T : class
Parameters
Type Name Description
IQueryable<T> query

The query to be executed.

CachingOptions options

The option that will be used to store the result set.

Returns
Type Description
IEnumerable<T>

Returns the result set of the query from cache if available else from the database and stores it in the cache.

Type Parameters
Name Description
T

The generic type of the collection

FromCache<T>(IQueryable<T>, out String, CachingOptions)

Checks if the result set is available in cache or not. If it is available it is fetched from the cache and returned however if it is not available the query is executed on the database and the result set is stored in cache as well as returned.

Declaration
public static IEnumerable<T> FromCache<T>(this IQueryable<T> query, out string cacheKey, CachingOptions options)
    where T : class
Parameters
Type Name Description
IQueryable<T> query

The query to be executed.

System.String cacheKey

The key against which the result set will be cached is returned as out parameter.

CachingOptions options

The option that will be used to store the result set.

Returns
Type Description
IEnumerable<T>

Returns the result set of the query from cache if available else from the database and stores it in the cache.

Type Parameters
Name Description
T

The generic type of the collection

FromCache<T>(QueryDeferred<T>, CachingOptions)

Checks if the result is available in cache or not. If it is available it is fetched from the cache and returned however if it is not available the query is executed on the database and the result is stored in cache as well as returned.

Declaration
public static T FromCache<T>(this QueryDeferred<T> query, CachingOptions options)
Parameters
Type Name Description
Alachisoft.NCache.EntityFrameworkCore.QueryDeferred<T> query

The query to be executed.

CachingOptions options

The option that will be used to store the result set.

Returns
Type Description
T

Returns the result set of the query from cache if available else from the database and stores it in the cache.

Type Parameters
Name Description
T

The generic type of the collection

FromCache<T>(QueryDeferred<T>, out String, CachingOptions)

Checks if the result is available in cache or not. If it is available it is fetched from the cache and returned however if it is not available the query is executed on the database and the result is stored in cache as well as returned.

Declaration
public static T FromCache<T>(this QueryDeferred<T> query, out string cacheKey, CachingOptions options)
Parameters
Type Name Description
Alachisoft.NCache.EntityFrameworkCore.QueryDeferred<T> query

The query to be executed.

System.String cacheKey

The key against which the result will be cached is returned as out parameter.

CachingOptions options

The option that will be used to store the result.

Returns
Type Description
T

Returns the result of the query from cache if available else from the database and stores it in the cache.

Type Parameters
Name Description
T

The generic type of the result

In This Article
  • FromCache<T>(IQueryable<T>, CachingOptions)
  • FromCache<T>(IQueryable<T>, out String, CachingOptions)
  • FromCache<T>(QueryDeferred<T>, CachingOptions)
  • FromCache<T>(QueryDeferred<T>, out String, CachingOptions)

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