QueryRouteBuilder.WithHandler(QueryHandler) Method
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.
Configures the route to use the specified asynchronous handler for processing query.
public Microsoft.Agents.Extensions.MSTeams.MessageExtensions.QueryRouteBuilder WithHandler(Microsoft.Agents.Extensions.MSTeams.MessageExtensions.QueryHandler handler);
member this.WithHandler : Microsoft.Agents.Extensions.MSTeams.MessageExtensions.QueryHandler -> Microsoft.Agents.Extensions.MSTeams.MessageExtensions.QueryRouteBuilder
Public Function WithHandler (handler As QueryHandler) As QueryRouteBuilder
Parameters
- handler
- QueryHandler
An asynchronous delegate that processes the query, receiving the turn context, turn state, deserialized data of type Microsoft.Teams.Api.MessageExtensions.Query, and a cancellation token.
Returns
The current instance of QueryRouteBuilder, enabling method chaining.
Remarks
Use this method to specify custom logic for handling queries in Teams message extensions. The handler receives the deserialized data from the incoming activity, allowing for type-safe processing of the query's payload.