MapRouteRouteBuilderExtensions.MapRoute 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
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)
将路由添加到 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)
将路由添加到 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)
将路由添加到 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)
将路由添加到 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
一个 对象,该对象包含路由的数据令牌。 对象的属性表示数据令牌的名称和值。
返回
完成操作后对此实例的引用。