Delegate RouterFactoryDelegate<TRouter, TConfig>
Creates a router instance from a configured RouterBuilder<TRouter, TConfig>.
Namespace: NanoRoute
Assembly: NanoRoute.dll
Syntax
public delegate TRouter RouterFactoryDelegate<TRouter, TConfig>(RouteScopeBuilder scope, TConfig config) where TRouter : RouterBase<TConfig> where TConfig : RouterConfig
Parameters
| Type | Name | Description |
|---|---|---|
| RouteScopeBuilder | scope | The route scope that contains the current route and parser registrations. |
| TConfig | config | The configuration assigned to the router instance being created. |
Returns
| Type | Description |
|---|---|
| TRouter | A |
Type Parameters
| Name | Description |
|---|---|
| TRouter | The concrete router type produced by the factory. |
| TConfig | The strongly typed router configuration used by the builder. |
Remarks
Exceptions thrown by the factory propagate to the caller of CreateRouter(Action<TConfig>).
Examples
var builder = new RouterBuilder<MyRouter, RouterConfig>(static (scope, config) => new MyRouter(scope, config));