Langue

BotState.GetPropertyValueAsync<T> Méthode

Définition

Obtient la valeur d’une propriété à partir du cache d’état pour cette BotStatefonction .

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)

Paramètres de type

T

Le type de valeur du bien.

Paramètres

turnContext
ITurnContext

Objet de contexte pour ce tour.

propertyName
String

Nom de la propriété.

cancellationToken
CancellationToken

Jeton d’annulation qui peut être utilisé par d’autres objets ou threads pour recevoir une notification d’annulation.

Retours

Task<T>

Tâche qui représente le travail mis en file d’attente à exécuter.

Exceptions

turnContext ou propertyName est null.

Remarques

Si la tâche réussit, le résultat contient la valeur de propriété, sinon il sera default(T).

S’applique à