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

Method FromCacheOnlyAsync

FromCacheOnlyAsync<T>(IQueryable<T>)

Executes the query on the cache Asynchronously and returns the result set as generic IEnumerable encapsulated as a task.

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

The query to be executed.

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 in the cache. In case of no result return the default values.

Type Parameters
Name Description
T

The generic type of the collection

FromCacheOnlyAsync<T>(QueryDeferred<T>)

Executes the query on the cache Asynchronously and returns the result set as generic IEnumerable encapsulated as a task.

Declaration
public static Task<T> FromCacheOnlyAsync<T>(this QueryDeferred<T> query)
Parameters
Type Name Description
Alachisoft.NCache.EntityFrameworkCore.QueryDeferred<T> query

The query to be executed.

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

Returns the result of the query (encapsulated in a task) after executing it in the cache. In case of no result return the default value.

Type Parameters
Name Description
T

The generic type of the result

Back to top Copyright © 2017 Alachisoft