EndpointRoutingApplicationBuilderExtensions.UseRouting 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将中间 Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware 件添加到指定的 IApplicationBuilder。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseRouting(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ builder);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseRouting (this Microsoft.AspNetCore.Builder.IApplicationBuilder builder);
static member UseRouting : Microsoft.AspNetCore.Builder.IApplicationBuilder -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseRouting (builder As IApplicationBuilder) As IApplicationBuilder
参数
- builder
- IApplicationBuilder
要 IApplicationBuilder 向其添加中间件的 。
返回
完成操作后对此实例的引用。
注解
对 的调用UseRouting(IApplicationBuilder)必须后跟对同IApplicationBuilder一实例的调用UseEndpoints(IApplicationBuilder, Action<IEndpointRouteBuilder>)。
定义 Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware 中间件管道中做出路由决策的点,并且 Endpoint 与 HttpContext相关联。 在 Microsoft.AspNetCore.Routing.EndpointMiddleware 中间件管道中定义执行当前 Endpoint 的点。 和 Microsoft.AspNetCore.Routing.EndpointMiddleware 之间的Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware中间件可能会观察到或更改Endpoint与 HttpContext关联的 。