BotState.GetPropertyValueAsync<T> 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從狀態快取中取得屬性 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)
類型參數
- T
房產的價值類型。
參數
- turnContext
- ITurnContext
這個回合的內容物件。
- propertyName
- String
屬性的名稱。
- cancellationToken
- CancellationToken
一種可被其他物件或執行緒用來接收取消通知的取消標記。
傳回
Task<T>
工作,表示要執行的工作佇列。
例外狀況
turnContext 或 propertyName 為 null。
備註
若任務成功,結果包含屬性值,否則為 default(T)。