CacheBase<T>.GetFromCacheAsync Method

Definition

Retrieves item represented by Uri from the cache. If the item is not found in the cache, it will try to downloaded and saved before returning it to the caller.

public System.Threading.Tasks.Task<T> GetFromCacheAsync (Uri uri, bool throwOnError = false, System.Threading.CancellationToken cancellationToken = default, System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<string,object>> initializerKeyValues = default);
member this.GetFromCacheAsync : Uri * bool * System.Threading.CancellationToken * System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<string, obj>> -> System.Threading.Tasks.Task<'T>
Public Function GetFromCacheAsync (uri As Uri, Optional throwOnError As Boolean = false, Optional cancellationToken As CancellationToken = Nothing, Optional initializerKeyValues As List(Of KeyValuePair(Of String, Object)) = Nothing) As Task(Of T)

Parameters

uri
Uri

Uri of the item.

throwOnError
Boolean

Indicates whether or not exception should be thrown if item cannot be found / downloaded.

cancellationToken
CancellationToken

instance of CancellationToken

initializerKeyValues
List<KeyValuePair<String,Object>>

key value pairs used when initializing instance of generic type

Returns

Task<T>

an instance of Generic type

Applies to