Condividi tramite


IStatePropertyAccessor<T>.GetAsync Metodo

Definizione

Ottiene il valore della proprietà dall'origine.

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)

Parametri

turnContext
ITurnContext

Contesto di turno.

defaultValueFactory
Func<T>

Funzione che definisce il valore della proprietà da restituire se non è stato impostato alcun valore.

cancellationToken
CancellationToken

Token di annullamento.

Restituisce

Task<T>

Oggetto Task che rappresenta il risultato dell'operazione asincrona.

Eccezioni

La proprietà non ha alcun valore e nessun valore defaultValueFactory.

Si applica a