RoutingBuilderExtensions.UseRouter Method

Definition

Overloads

UseRouter(IApplicationBuilder, IRouter)

Adds a RouterMiddleware middleware to the specified IApplicationBuilder with the specified IRouter.

UseRouter(IApplicationBuilder, Action<IRouteBuilder>)

Adds a RouterMiddleware middleware to the specified IApplicationBuilder with the IRouter built from configured IRouteBuilder.

UseRouter(IApplicationBuilder, IRouter)

Adds a RouterMiddleware middleware to the specified IApplicationBuilder with the specified IRouter.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseRouter(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ builder, Microsoft::AspNetCore::Routing::IRouter ^ router);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseRouter (this Microsoft.AspNetCore.Builder.IApplicationBuilder builder, Microsoft.AspNetCore.Routing.IRouter router);
static member UseRouter : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Routing.IRouter -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseRouter (builder As IApplicationBuilder, router As IRouter) As IApplicationBuilder

Parameters

builder
IApplicationBuilder

The IApplicationBuilder to add the middleware to.

router
IRouter

The IRouter to use for routing requests.

Returns

A reference to this instance after the operation has completed.

Applies to

UseRouter(IApplicationBuilder, Action<IRouteBuilder>)

Adds a RouterMiddleware middleware to the specified IApplicationBuilder with the IRouter built from configured IRouteBuilder.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseRouter(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ builder, Action<Microsoft::AspNetCore::Routing::IRouteBuilder ^> ^ action);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseRouter (this Microsoft.AspNetCore.Builder.IApplicationBuilder builder, Action<Microsoft.AspNetCore.Routing.IRouteBuilder> action);
static member UseRouter : Microsoft.AspNetCore.Builder.IApplicationBuilder * Action<Microsoft.AspNetCore.Routing.IRouteBuilder> -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseRouter (builder As IApplicationBuilder, action As Action(Of IRouteBuilder)) As IApplicationBuilder

Parameters

builder
IApplicationBuilder

The IApplicationBuilder to add the middleware to.

action
Action<IRouteBuilder>

An Action<T> to configure the provided IRouteBuilder.

Returns

A reference to this instance after the operation has completed.

Applies to