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>(RouterBuilder<TRouter, TConfig> routerBuilder) where TRouter : Router where TConfig : RouterConfig, new()
Parameters
Type Name Description
RouterBuilder<TRouter, TConfig> routerBuilder

The builder that contains the current route registrations, parser registrations, metadata, and configuration.

Returns
Type Description
TRouter

A TRouter instance backed by the builder's current route snapshot.

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().

Examples
var builder = new RouterBuilder<MyRouter, RouterConfig>(static b => new MyRouter(b));
In this article
Back to top Generated by DocFX