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 |
---|---|---|
IQueryable<T> | query | The query to be executed. |
Returns
Type | Description |
---|---|
Task<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 |
---|---|
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 |