BotState.SetPropertyValueAsync 方法

定义

在状态缓存 BotState中设置属性的值。

protected System.Threading.Tasks.Task SetPropertyValueAsync(Microsoft.Bot.Builder.ITurnContext turnContext, string propertyName, object value, System.Threading.CancellationToken cancellationToken = default);
member this.SetPropertyValueAsync : Microsoft.Bot.Builder.ITurnContext * string * obj * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Protected Function SetPropertyValueAsync (turnContext As ITurnContext, propertyName As String, value As Object, Optional cancellationToken As CancellationToken = Nothing) As Task

参数

turnContext
ITurnContext

此轮次的上下文对象。

propertyName
String

要设置的属性的名称。

value
Object

要在属性上设置的值。

cancellationToken
CancellationToken

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

返回

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

例外

turnContextpropertyNamenull.

适用于