BotState.GetPropertyValueAsync<T> Method

Definition

Gets the value of a property from the state cache for this 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)

Type Parameters

T

The value type of the property.

Parameters

turnContext
ITurnContext

The context object for this turn.

propertyName
String

The name of the property.

cancellationToken
CancellationToken

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

Returns

Task<T>

A task that represents the work queued to execute.

Exceptions

turnContext or propertyName is null.

Remarks

If the task is successful, the result contains the property value, otherwise it will be default(T).

Applies to