RoutingBuilderExtensions.UseRouter RoutingBuilderExtensions.UseRouter RoutingBuilderExtensions.UseRouter Method

Definition

Overloads

UseRouter(IApplicationBuilder, IRouter) UseRouter(IApplicationBuilder, IRouter) UseRouter(IApplicationBuilder, IRouter)

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

UseRouter(IApplicationBuilder, Action<IRouteBuilder>) UseRouter(IApplicationBuilder, Action<IRouteBuilder>) UseRouter(IApplicationBuilder, Action<IRouteBuilder>)

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

UseRouter(IApplicationBuilder, IRouter) UseRouter(IApplicationBuilder, IRouter) UseRouter(IApplicationBuilder, IRouter)

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

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
router
IRouter IRouter IRouter

The IRouter to use for routing requests.

Returns

A reference to this instance after the operation has completed.

UseRouter(IApplicationBuilder, Action<IRouteBuilder>) UseRouter(IApplicationBuilder, Action<IRouteBuilder>) UseRouter(IApplicationBuilder, Action<IRouteBuilder>)

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

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
action
Action<IRouteBuilder>

An Action<T> to configure the provided IRouteBuilder.

Returns

A reference to this instance after the operation has completed.

Applies to