Table of Contents

Delegate UpdateActivityHandler

Namespace
Microsoft.Agents.Builder
Assembly
Microsoft.Agents.Builder.dll

A method that can participate in update activity events for the current turn.

public delegate Task<ResourceResponse> UpdateActivityHandler(ITurnContext turnContext, IActivity activity, Func<Task<ResourceResponse>> next)

Parameters

turnContext ITurnContext

The context object for the turn.

activity IActivity

The replacement activity.

next Func<Task<ResourceResponse>>

The delegate to call to continue event processing.

Returns

Task<ResourceResponse>

A task that represents the work queued to execute.

Remarks

A handler calls the next delegate to pass control to the next registered handler. If a handler doesn’t call the next delegate, the adapter does not call any of the subsequent handlers and does not update the activity.

The activity's Microsoft.Agents.Core.Models.Activity.Id indicates the activity in the conversation to replace.

If the activity is successfully sent, the next delegate returns a Microsoft.Agents.Core.Models.ResourceResponse object containing the ID that the receiving channel assigned to the activity. Use this response object as the return value of this handler.

Constructors

UpdateActivityHandler(object, nint)

public UpdateActivityHandler(object @object, nint method)

Parameters

object object
method nint

Methods

BeginInvoke(ITurnContext, IActivity, Func<Task<ResourceResponse>>, AsyncCallback, object)

public virtual IAsyncResult BeginInvoke(ITurnContext turnContext, IActivity activity, Func<Task<ResourceResponse>> next, AsyncCallback callback, object @object)

Parameters

turnContext ITurnContext
activity IActivity
next Func<Task<ResourceResponse>>
callback AsyncCallback
object object

Returns

IAsyncResult

EndInvoke(IAsyncResult)

public virtual Task<ResourceResponse> EndInvoke(IAsyncResult result)

Parameters

result IAsyncResult

Returns

Task<ResourceResponse>

Invoke(ITurnContext, IActivity, Func<Task<ResourceResponse>>)

public virtual Task<ResourceResponse> Invoke(ITurnContext turnContext, IActivity activity, Func<Task<ResourceResponse>> next)

Parameters

turnContext ITurnContext
activity IActivity
next Func<Task<ResourceResponse>>

Returns

Task<ResourceResponse>

See Also