Delegate UpdateActivityHandler
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
ITurnContextThe context object for the turn.
activity
IActivityThe 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
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
ITurnContextactivity
IActivitynext
Func<Task<ResourceResponse>>callback
AsyncCallbackobject
object
Returns
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
ITurnContextactivity
IActivitynext
Func<Task<ResourceResponse>>
Returns
- Task<ResourceResponse>