Share via


StorageExtensions.ReadAsync<TStoreItem> Method

Definition

Gets and strongly types a collection of IStoreItem objects from state storage.

public static System.Threading.Tasks.Task<System.Collections.Generic.IDictionary<string,TStoreItem>> ReadAsync<TStoreItem> (this Microsoft.Bot.Builder.IStorage storage, string[] keys, System.Threading.CancellationToken cancellationToken = default) where TStoreItem : class;
static member ReadAsync : Microsoft.Bot.Builder.IStorage * string[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IDictionary<string, 'StoreItem>> (requires 'StoreItem : null)
<Extension()>
Public Function ReadAsync(Of TStoreItem As Class) (storage As IStorage, keys As String(), Optional cancellationToken As CancellationToken = Nothing) As Task(Of IDictionary(Of String, TStoreItem))

Type Parameters

TStoreItem

The type of item to get from storage.

Parameters

storage
IStorage

The state storage.

keys
String[]

The collection of keys for the objects to get from storage.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<IDictionary<String,TStoreItem>>

A task that represents the work queued to execute.

Remarks

If the task completes successfully, the result contains a dictionary of the strongly typed objects, indexed by the keys.

Applies to