语言

BotState.GetPropertyValueAsync<T> 方法

定义

从状态缓存 BotState中获取该属性的值。

protected System.Threading.Tasks.Task<T> GetPropertyValueAsync<T>(Microsoft.Bot.Builder.ITurnContext turnContext, string propertyName, System.Threading.CancellationToken cancellationToken = default);
member this.GetPropertyValueAsync : Microsoft.Bot.Builder.ITurnContext * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
Protected Function GetPropertyValueAsync(Of T) (turnContext As ITurnContext, propertyName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of T)

类型参数

T

房产的价值类型。

参数

turnContext
ITurnContext

此轮次的上下文对象。

propertyName
String

属性的名称。

cancellationToken
CancellationToken

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

返回

Task<T>

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

例外

turnContext 或 propertyName 为 null.

注解

如果任务成功,结果包含属性值,否则将为 default(T)。

适用于