Share via


AgentApplication.AddRoute Method

Definition

Adds a new route to the application.

Developers won't typically need to call this method directly as it's used internally by all of the fluent interfaces to register routes for their specific activity types.

Routes will be matched in the order they're added to the application. The first selector to return true when an activity is received will have its handler called.

Invoke-based activities receive special treatment and are matched separately as they typically have shorter execution timeouts.

public Microsoft.Agents.Builder.App.AgentApplication AddRoute(Microsoft.Agents.Builder.App.RouteSelector selector, Microsoft.Agents.Builder.App.RouteHandler handler, bool isInvokeRoute = false, ushort rank = 32767, string[] autoSignInHandlers = default);
member this.AddRoute : Microsoft.Agents.Builder.App.RouteSelector * Microsoft.Agents.Builder.App.RouteHandler * bool * uint16 * string[] -> Microsoft.Agents.Builder.App.AgentApplication
Public Function AddRoute (selector As RouteSelector, handler As RouteHandler, Optional isInvokeRoute As Boolean = false, Optional rank As UShort = 32767, Optional autoSignInHandlers As String() = Nothing) As AgentApplication

Parameters

selector
RouteSelector

Function that's used to select a route. The function returning true triggers the route.

handler
RouteHandler

Function to call when the route is triggered.

isInvokeRoute
Boolean

Boolean indicating if the RouteSelector is for an activity that uses "invoke" which require special handling. Defaults to false.

rank
UInt16

0 - ushort.MaxValue for order of evaluation. Ranks of the same value are evaluated in order of addition.

autoSignInHandlers
String[]

Returns

The application instance for chaining purposes.

Applies to