Class RouterConfig
Configures runtime routing behavior for router instances.
Inherited Members
Namespace: NanoRoute
Assembly: NanoRoute.dll
Syntax
public class RouterConfig
Examples
HttpMessageRouter router = builder.CreateRouter(config =>
{
config.MatchingPrecedence = MatchingPrecedence.ParameterizedFirst;
});
Constructors
RouterConfig()
Declaration
public RouterConfig()
Properties
MatchingPrecedence
Gets or sets how NanoRoute prioritizes literal and parameterized child segments at the same depth.
Declaration
public MatchingPrecedence MatchingPrecedence { get; set; }
Property Value
| Type | Description |
|---|---|
| MatchingPrecedence |
Examples
HttpMessageRouter router = builder.CreateRouter(config =>
{
config.MatchingPrecedence = MatchingPrecedence.ParameterizedFirst;
});
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown when the assigned value is not a defined MatchingPrecedence value. |