Language

TeamsTaskSubmitRouteAttribute Class

Definition

Attribute to define a route that handles Teams task module submit events. The decorated method must match the TaskSubmitHandler delegate signature — the third parameter must be Microsoft.Teams.Api.TaskModules.Request.

[Microsoft.Agents.Builder.App.RouteHandlerType(typeof(Microsoft.Agents.Extensions.MSTeams.TaskModules.TaskSubmitHandler))]
[System.AttributeUsage(System.AttributeTargets.Method, Inherited=true)]
public class TeamsTaskSubmitRouteAttribute : Attribute, Microsoft.Agents.Builder.App.IRouteAttribute
[<Microsoft.Agents.Builder.App.RouteHandlerType(typeof(Microsoft.Agents.Extensions.MSTeams.TaskModules.TaskSubmitHandler))>]
[<System.AttributeUsage(System.AttributeTargets.Method, Inherited=true)>]
type TeamsTaskSubmitRouteAttribute = class
    inherit Attribute
    interface IRouteAttribute
Public Class TeamsTaskSubmitRouteAttribute
Inherits Attribute
Implements IRouteAttribute
Inheritance
TeamsTaskSubmitRouteAttribute
Attributes
Implements

Remarks

Decorate a method with this attribute to register it as a handler for Teams task module submit events.

[TeamsTaskSubmitRoute("myKey")]
public async Task<Microsoft.Teams.Api.TaskModules.Response> OnSubmitAsync(ITeamsTurnContext turnContext, ITurnState turnState, Microsoft.Teams.Api.TaskModules.Request request, CancellationToken cancellationToken)
{
    // Handle task module submit event
}

Alternatively, OnSubmit(String, TaskSubmitHandler, String, String[], UInt16) can be used to register the handler via the fluent API.

Constructors

Name Description
TeamsTaskSubmitRouteAttribute(String, String, Boolean, UInt16, String)

Attribute to define a route that handles Teams task module submit events. The decorated method must match the TaskSubmitHandler delegate signature — the third parameter must be Microsoft.Teams.Api.TaskModules.Request.

Methods

Name Description
AddRoute(AgentApplication, MethodInfo)

Applies to