Language

TypedTurnContext<T> Class

Definition

A TurnContext with a strongly typed Activity property that wraps an untyped inner TurnContext.

public class TypedTurnContext<T> : Microsoft.Agents.Builder.ITurnContext<T> where T : IActivity
type TypedTurnContext<'T (requires 'T :> IActivity)> = class
    interface ITurnContext<'T (requires 'T :> IActivity)>
    interface ITurnContext
Public Class TypedTurnContext(Of T)
Implements ITurnContext(Of T)

Type Parameters

T

An IActivity derived type, that is one of IMessageActivity, IConversationUpdateActivity etc.

Inheritance
TypedTurnContext<T>
Implements

Constructors

Name Description
TypedTurnContext<T>(ITurnContext)

Initializes a new instance of the TypedTurnContext<T> class.

Properties

Name Description
Activity

Gets the activity for this turn of the bot.

Adapter

Gets the bot adapter that created this context object.

Identity
Responded

Gets a value indicating whether at least one response was sent for the current turn.

Services

Gets the collection of values cached with the context object for the lifetime of the turn.

StackState

Gets the collection of values cached with the context object for the lifetime of the turn.

StreamingResponse

Methods

Name Description
DeleteActivityAsync(ConversationReference, CancellationToken)

Deletes an existing activity.

DeleteActivityAsync(String, CancellationToken)

Deletes an existing activity.

OnDeleteActivity(DeleteActivityHandler)

Adds a response handler for delete activity operations.

OnSendActivities(SendActivitiesHandler)

Adds a response handler for send activity operations.

OnUpdateActivity(UpdateActivityHandler)

Adds a response handler for update activity operations.

SendActivitiesAsync(IActivity[], CancellationToken)

Sends a set of activities to the sender of the incoming activity.

SendActivityAsync(IActivity, CancellationToken)

Sends an activity to the sender of the incoming activity.

SendActivityAsync(String, String, String, CancellationToken)

Sends a message activity to the sender of the incoming activity.

TraceActivityAsync(String, Object, String, String, CancellationToken)
UpdateActivityAsync(IActivity, CancellationToken)

Replaces an existing activity.

Explicit Interface Implementations

Name Description
ITurnContext<T>.Activity

Gets the inner context's activity, cast to the type parameter of this TypedTurnContext<T>.

Extension Methods

Name Description
ExchangeTurnTokenAsync(ITurnContext, String, String, IList<String>, CancellationToken)
GetDebugger(ITurnContext)

Extension method to get IDialogDebugger from TurnContext.

GetTurnTokenAsync(ITurnContext, String, CancellationToken)
GetTurnTokens(ITurnContext)
IsAgenticRequest(ITurnContext)

Applies to