共用方式為


RequestDelegateRouteBuilderExtensions.MapRoute 方法

定義

多載

MapRoute(IRouteBuilder, String, RequestDelegate)

將路由新增至 IRouteBuilder 指定 template 、 和 handler 的 。

MapRoute(IRouteBuilder, String, Action<IApplicationBuilder>)

將路由新增至 IRouteBuilder 指定 template 、 和 action 的 。

MapRoute(IRouteBuilder, String, RequestDelegate)

來源:
RequestDelegateRouteBuilderExtensions.cs
來源:
RequestDelegateRouteBuilderExtensions.cs
來源:
RequestDelegateRouteBuilderExtensions.cs

將路由新增至 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

參數

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

參數

template
String

路由範本。

action
Action<IApplicationBuilder>

要套用至 的 IApplicationBuilder 動作。

傳回

完成此作業之後的 builder 參考。

適用於