TeamsTeamUpdateRouteAttribute Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Attribute to define a route that handles any Teams team update event.
[Microsoft.Agents.Builder.App.RouteHandlerType(typeof(Microsoft.Agents.Extensions.MSTeams.Teams.TeamUpdateHandler))]
[System.AttributeUsage(System.AttributeTargets.Method, Inherited=true)]
public class TeamsTeamUpdateRouteAttribute : Attribute, Microsoft.Agents.Builder.App.IRouteAttribute
[<Microsoft.Agents.Builder.App.RouteHandlerType(typeof(Microsoft.Agents.Extensions.MSTeams.Teams.TeamUpdateHandler))>]
[<System.AttributeUsage(System.AttributeTargets.Method, Inherited=true)>]
type TeamsTeamUpdateRouteAttribute = class
inherit Attribute
interface IRouteAttribute
Public Class TeamsTeamUpdateRouteAttribute
Inherits Attribute
Implements IRouteAttribute
- Inheritance
-
TeamsTeamUpdateRouteAttribute
- Attributes
- Implements
Remarks
Decorate a method with this attribute to register it as a handler for all team update events in Teams, including archived, unarchived, deleted, renamed, and restored. Use the specific event attributes (e.g., TeamsTeamArchivedRouteAttribute) to handle individual event types. The method must match the TeamUpdateHandler delegate signature.
[TeamsTeamUpdateRoute]
public async Task OnAnyTeamEventAsync(ITeamsTurnContext turnContext, ITurnState turnState, Microsoft.Teams.Apps.Schema.Team team, CancellationToken cancellationToken)
{
// Handle any team update event
}
Alternatively, OnTeamEventReceived(TeamUpdateHandler, String[], UInt16) can be used to register the handler via the fluent API.
Constructors
| Name | Description |
|---|---|
| TeamsTeamUpdateRouteAttribute(Boolean, UInt16, String) |
Attribute to define a route that handles any Teams team update event. |
Methods
| Name | Description |
|---|---|
| AddRoute(AgentApplication, MethodInfo) |
Registers a route for the specified method within the given agent application. |