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

Method LoadIntoCacheAsync

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

Executes the query on the database irrespective of the fact that the result set could have been in the cache and could have been served from there and updates the result set in the cache.

Declaration
public static Task<IEnumerable<T>> LoadIntoCacheAsync<T>(this IQueryable<T> query, CachingOptions options)
    where T : class
Parameters
Type Name Description
System.Linq.IQueryable<T> query

The query to be executed.

CachingOptions options

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

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<T>>

Returns the result set of the query (encapsulated in a task) after executing it on the databse and storing it in the cache.

Type Parameters
Name Description
T

The generic type of the collection

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

Executes the query on the database irrespective of the fact that the result could have been in the cache and could have been served from there and updates the result in the cache.

Declaration
public static Task<T> LoadIntoCacheAsync<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.

Returns
Type Description
System.Threading.Tasks.Task<T>

Returns the result of the query (encapsulated in a task) after executing it on the databse and storing it in the cache.

Type Parameters
Name Description
T

The generic type of the collection

Back to top Copyright © 2017 Alachisoft