共用方式為


ControllerEndpointRouteBuilderExtensions.MapDefaultControllerRoute 方法

定義

將控制器動作的端點新增至 IEndpointRouteBuilder ,並新增預設路由 {controller=Home}/{action=Index}/{id?}

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::ControllerActionEndpointConventionBuilder ^ MapDefaultControllerRoute(Microsoft::AspNetCore::Routing::IEndpointRouteBuilder ^ endpoints);
public static Microsoft.AspNetCore.Builder.ControllerActionEndpointConventionBuilder MapDefaultControllerRoute (this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints);
static member MapDefaultControllerRoute : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder -> Microsoft.AspNetCore.Builder.ControllerActionEndpointConventionBuilder
<Extension()>
Public Function MapDefaultControllerRoute (endpoints As IEndpointRouteBuilder) As ControllerActionEndpointConventionBuilder

參數

傳回

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

適用於