ภาษา

TeamsTaskFetchRouteAttribute Class

Definition

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

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

Remarks

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

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

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

Constructors

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

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

Methods

Name Description
AddRoute(AgentApplication, MethodInfo)

Applies to