BotState.GetPropertyValueAsync<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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).