StorageExtensions.ReadAsync<TStoreItem> 方法

定义

从状态存储中获取并强类型一组 IStoreItem 对象。

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))

类型参数

TStoreItem

从储藏室取的物品类型。

参数

storage
IStorage

州级存储。

keys
String[]

对象从存储中获取的密钥集合。

cancellationToken
CancellationToken

其他对象或线程可以使用的取消令牌来接收取消通知。

返回

Task<IDictionary<String,TStoreItem>>

表示要执行的工作的任务。

注解

如果任务成功完成,结果中包含强类型对象的字典,并 keys由 索引。

适用于