BotState.SetPropertyValueAsync Method

Definition

Sets the value of a property in the state cache for this 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

Parameters

turnContext
ITurnContext

The context object for this turn.

propertyName
String

The name of the property to set.

value
Object

The value to set on the property.

cancellationToken
CancellationToken

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

Returns

A task that represents the work queued to execute.

Exceptions

turnContext or propertyName is null.

Applies to