共用方式為


MapRouteRouteBuilderExtensions.MapRoute 方法

定義

多載

MapRoute(IRouteBuilder, String, String)

將路由新增至 IRouteBuilder 具有指定名稱和範本的 。

MapRoute(IRouteBuilder, String, String, Object)

使用指定的名稱、範本和預設值,將路由加入至 IRouteBuilder

MapRoute(IRouteBuilder, String, String, Object, Object)

使用指定的名稱、範本、預設值和條件約束,將路由新增至 IRouteBuilder

MapRoute(IRouteBuilder, String, String, Object, Object, Object)

使用指定的名稱、範本、預設值和資料權杖,將路由 IRouteBuilder 加入至 。

MapRoute(IRouteBuilder, String, String)

來源:
MapRouteRouteBuilderExtensions.cs
來源:
MapRouteRouteBuilderExtensions.cs
來源:
MapRouteRouteBuilderExtensions.cs

將路由新增至 IRouteBuilder 具有指定名稱和範本的 。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Routing::IRouteBuilder ^ MapRoute(Microsoft::AspNetCore::Routing::IRouteBuilder ^ routeBuilder, System::String ^ name, System::String ^ template);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string name, string template);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string? name, string? template);
static member MapRoute : Microsoft.AspNetCore.Routing.IRouteBuilder * string * string -> Microsoft.AspNetCore.Routing.IRouteBuilder
<Extension()>
Public Function MapRoute (routeBuilder As IRouteBuilder, name As String, template As String) As IRouteBuilder

參數

routeBuilder
IRouteBuilder

IRouteBuilder 加入路由的 。

name
String

路由的名稱。

template
String

路由的 URL 模式。

傳回

完成作業之後,這個執行個體的參考。

適用於

MapRoute(IRouteBuilder, String, String, Object)

來源:
MapRouteRouteBuilderExtensions.cs
來源:
MapRouteRouteBuilderExtensions.cs
來源:
MapRouteRouteBuilderExtensions.cs

使用指定的名稱、範本和預設值,將路由加入至 IRouteBuilder

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Routing::IRouteBuilder ^ MapRoute(Microsoft::AspNetCore::Routing::IRouteBuilder ^ routeBuilder, System::String ^ name, System::String ^ template, System::Object ^ defaults);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string name, string template, object defaults);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string? name, string? template, object? defaults);
static member MapRoute : Microsoft.AspNetCore.Routing.IRouteBuilder * string * string * obj -> Microsoft.AspNetCore.Routing.IRouteBuilder
<Extension()>
Public Function MapRoute (routeBuilder As IRouteBuilder, name As String, template As String, defaults As Object) As IRouteBuilder

參數

routeBuilder
IRouteBuilder

IRouteBuilder 加入路由的 。

name
String

路由的名稱。

template
String

路由的 URL 模式。

defaults
Object

物件,包含路由參數的預設值。 物件的屬性代表預設值的名稱和值。

傳回

完成作業之後,這個執行個體的參考。

適用於

MapRoute(IRouteBuilder, String, String, Object, Object)

來源:
MapRouteRouteBuilderExtensions.cs
來源:
MapRouteRouteBuilderExtensions.cs
來源:
MapRouteRouteBuilderExtensions.cs

使用指定的名稱、範本、預設值和條件約束,將路由新增至 IRouteBuilder

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Routing::IRouteBuilder ^ MapRoute(Microsoft::AspNetCore::Routing::IRouteBuilder ^ routeBuilder, System::String ^ name, System::String ^ template, System::Object ^ defaults, System::Object ^ constraints);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string name, string template, object defaults, object constraints);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string? name, string? template, object? defaults, object? constraints);
static member MapRoute : Microsoft.AspNetCore.Routing.IRouteBuilder * string * string * obj * obj -> Microsoft.AspNetCore.Routing.IRouteBuilder
<Extension()>
Public Function MapRoute (routeBuilder As IRouteBuilder, name As String, template As String, defaults As Object, constraints As Object) As IRouteBuilder

參數

routeBuilder
IRouteBuilder

IRouteBuilder 加入路由的 。

name
String

路由的名稱。

template
String

路由的 URL 模式。

defaults
Object

物件,包含路由參數的預設值。 物件的屬性代表預設值的名稱和值。

constraints
Object

物件,包含路由的條件約束。 物件的屬性代表條件約束的名稱和值。

傳回

完成作業之後,這個執行個體的參考。

適用於

MapRoute(IRouteBuilder, String, String, Object, Object, Object)

來源:
MapRouteRouteBuilderExtensions.cs
來源:
MapRouteRouteBuilderExtensions.cs
來源:
MapRouteRouteBuilderExtensions.cs

使用指定的名稱、範本、預設值和資料權杖,將路由 IRouteBuilder 加入至 。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Routing::IRouteBuilder ^ MapRoute(Microsoft::AspNetCore::Routing::IRouteBuilder ^ routeBuilder, System::String ^ name, System::String ^ template, System::Object ^ defaults, System::Object ^ constraints, System::Object ^ dataTokens);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string name, string template, object defaults, object constraints, object dataTokens);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string? name, string? template, object? defaults, object? constraints, object? dataTokens);
static member MapRoute : Microsoft.AspNetCore.Routing.IRouteBuilder * string * string * obj * obj * obj -> Microsoft.AspNetCore.Routing.IRouteBuilder
<Extension()>
Public Function MapRoute (routeBuilder As IRouteBuilder, name As String, template As String, defaults As Object, constraints As Object, dataTokens As Object) As IRouteBuilder

參數

routeBuilder
IRouteBuilder

IRouteBuilder 加入路由的 。

name
String

路由的名稱。

template
String

路由的 URL 模式。

defaults
Object

物件,包含路由參數的預設值。 物件的屬性代表預設值的名稱和值。

constraints
Object

物件,包含路由的條件約束。 物件的屬性代表條件約束的名稱和值。

dataTokens
Object

物件,包含路由的資料權杖。 物件的屬性代表資料標記的名稱和值。

傳回

完成作業之後,這個執行個體的參考。

適用於