RoutingBuilderExtensions.UseRouter 方法

定义

重载

UseRouter(IApplicationBuilder, IRouter)

使用 RouterMiddleware 指定的 IApplicationBuilder 将中间件添加到指定的 IRouter

UseRouter(IApplicationBuilder, Action<IRouteBuilder>)

RouterMiddleware使用从配置的 IRouteBuilder生成的 将中间件添加到指定的 IApplicationBuilderIRouter

UseRouter(IApplicationBuilder, IRouter)

Source:
RoutingBuilderExtensions.cs
Source:
RoutingBuilderExtensions.cs
Source:
RoutingBuilderExtensions.cs

使用 RouterMiddleware 指定的 IApplicationBuilder 将中间件添加到指定的 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

参数

builder
IApplicationBuilder

IApplicationBuilder 向其添加中间件的 。

router
IRouter

用于 IRouter 路由请求的 。

返回

完成操作后对此实例的引用。

适用于

UseRouter(IApplicationBuilder, Action<IRouteBuilder>)

Source:
RoutingBuilderExtensions.cs
Source:
RoutingBuilderExtensions.cs
Source:
RoutingBuilderExtensions.cs

RouterMiddleware使用从配置的 IRouteBuilder生成的 将中间件添加到指定的 IApplicationBuilderIRouter

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

参数

builder
IApplicationBuilder

IApplicationBuilder 向其添加中间件的 。

action
Action<IRouteBuilder>

用于配置所提供的 IRouteBuilderAction<T>

返回

完成操作后对此实例的引用。

适用于