MessageRouteBuilderBase<TBuilder>.WithSelector(RouteSelector) Method

Definition

Sets a custom route selector used to determine how incoming requests are matched to this route builder.

public override TBuilder WithSelector(Microsoft.Agents.Builder.App.RouteSelector selector);
override this.WithSelector : Microsoft.Agents.Builder.App.RouteSelector -> 'Builder
Public Overrides Function WithSelector (selector As RouteSelector) As TBuilder

Parameters

selector
RouteSelector

The route selector that defines the criteria for matching requests to the route. The supplied selector does not need to validate base route properties like ChannelId, Agentic, etc. An Activity type of "message" is enforced.

Returns

TBuilder

The current builder instance with the specified selector applied.

Remarks

Use this method to customize the matching logic for routes. This allows for advanced routing scenarios where requests are selected based on custom rules or patterns. If WithText was also called, this selector is in addition to the Text selector.

Applies to