DialogSet.CreateContextAsync(ITurnContext, CancellationToken) Method

Definition

Creates a DialogContext which can be used to work with the dialogs in the DialogSet.

public System.Threading.Tasks.Task<Microsoft.Bot.Builder.Dialogs.DialogContext> CreateContextAsync (Microsoft.Bot.Builder.ITurnContext turnContext, System.Threading.CancellationToken cancellationToken = default);
member this.CreateContextAsync : Microsoft.Bot.Builder.ITurnContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.Dialogs.DialogContext>
Public Function CreateContextAsync (turnContext As ITurnContext, Optional cancellationToken As CancellationToken = Nothing) As Task(Of DialogContext)

Parameters

turnContext
ITurnContext

Context for the current turn of conversation with the user.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<DialogContext>

A Task representing the asynchronous operation.

Remarks

If the task is successful, the result contains the created DialogContext.

Applies to