RequestDelegateRouteBuilderExtensions.MapRoute 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
MapRoute(IRouteBuilder, String, RequestDelegate) |
将路由添加到 IRouteBuilder 给定 |
MapRoute(IRouteBuilder, String, Action<IApplicationBuilder>) |
将路由添加到 IRouteBuilder 给定 |
MapRoute(IRouteBuilder, String, RequestDelegate)
将路由添加到 IRouteBuilder 给定 template
的 、 和 handler
。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Routing::IRouteBuilder ^ MapRoute(Microsoft::AspNetCore::Routing::IRouteBuilder ^ builder, System::String ^ template, Microsoft::AspNetCore::Http::RequestDelegate ^ handler);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder builder, string template, Microsoft.AspNetCore.Http.RequestDelegate handler);
static member MapRoute : Microsoft.AspNetCore.Routing.IRouteBuilder * string * Microsoft.AspNetCore.Http.RequestDelegate -> Microsoft.AspNetCore.Routing.IRouteBuilder
<Extension()>
Public Function MapRoute (builder As IRouteBuilder, template As String, handler As RequestDelegate) As IRouteBuilder
参数
- builder
- IRouteBuilder
- template
- String
路由模板。
- handler
- RequestDelegate
路由 RequestDelegate 处理程序。
返回
此操作完成后对 builder
的引用。
适用于
MapRoute(IRouteBuilder, String, Action<IApplicationBuilder>)
将路由添加到 IRouteBuilder 给定 template
的 、 和 action
。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Routing::IRouteBuilder ^ MapRoute(Microsoft::AspNetCore::Routing::IRouteBuilder ^ builder, System::String ^ template, Action<Microsoft::AspNetCore::Builder::IApplicationBuilder ^> ^ action);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder builder, string template, Action<Microsoft.AspNetCore.Builder.IApplicationBuilder> action);
static member MapRoute : Microsoft.AspNetCore.Routing.IRouteBuilder * string * Action<Microsoft.AspNetCore.Builder.IApplicationBuilder> -> Microsoft.AspNetCore.Routing.IRouteBuilder
<Extension()>
Public Function MapRoute (builder As IRouteBuilder, template As String, action As Action(Of IApplicationBuilder)) As IRouteBuilder
参数
- builder
- IRouteBuilder
- template
- String
路由模板。
- action
- Action<IApplicationBuilder>
要应用于 的操作 IApplicationBuilder。
返回
此操作完成后对 builder
的引用。