IStatePropertyAccessor<T>.GetAsync 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 property value from the source.
public System.Threading.Tasks.Task<T> GetAsync (Microsoft.Bot.Builder.ITurnContext turnContext, Func<T> defaultValueFactory = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAsync : Microsoft.Bot.Builder.ITurnContext * Func<'T> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
Public Function GetAsync (turnContext As ITurnContext, Optional defaultValueFactory As Func(Of T) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of T)
Parameters
- turnContext
- ITurnContext
Turn Context.
- defaultValueFactory
- Func<T>
Function which defines the property value to be returned if no value has been set.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
Task<T>
A Task representing the result of the asynchronous operation.
Exceptions
The property has no value and no defaultValueFactory
.