共用方式為


ControllerEndpointRouteBuilderExtensions.MapAreaControllerRoute 方法

定義

將控制器動作的端點加入 至 IEndpointRouteBuilder ,並指定具有指定 nameareaNamepatterndefaultsconstraintsdataTokens 的路由。

public static Microsoft.AspNetCore.Builder.ControllerActionEndpointConventionBuilder MapAreaControllerRoute (this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string name, string areaName, string pattern, object defaults = default, object constraints = default, object dataTokens = default);
public static Microsoft.AspNetCore.Builder.ControllerActionEndpointConventionBuilder MapAreaControllerRoute (this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string name, string areaName, string pattern, object? defaults = default, object? constraints = default, object? dataTokens = default);
static member MapAreaControllerRoute : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string * string * string * obj * obj * obj -> Microsoft.AspNetCore.Builder.ControllerActionEndpointConventionBuilder
<Extension()>
Public Function MapAreaControllerRoute (endpoints As IEndpointRouteBuilder, name As String, areaName As String, pattern As String, Optional defaults As Object = Nothing, Optional constraints As Object = Nothing, Optional dataTokens As Object = Nothing) As ControllerActionEndpointConventionBuilder

參數

endpoints
IEndpointRouteBuilder

IEndpointRouteBuilder要加入路由的 。

name
String

路由的名稱。

areaName
String

區功能變數名稱稱。

pattern
String

路由的 URL 模式。

defaults
Object

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

constraints
Object

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

dataTokens
Object

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

傳回

ControllerActionEndpointConventionBuilder 用於與此路由之控制器動作相關聯的端點。

適用於