共用方式為


RoutingEndpointConventionBuilderExtensions.WithName<TBuilder> 方法

定義

IEndpointNameMetadata針對在目標 endpointNameIEndpointConventionBuilder 產生之所有端點,將 加入至元資料集合。 端點 IEndpointNameMetadata 上的 會用於連結產生,並視為指定端點 OpenAPI 規格中的作業識別碼。

public static TBuilder WithName<TBuilder> (this TBuilder builder, string endpointName) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member WithName : 'Builder * string -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function WithName(Of TBuilder As IEndpointConventionBuilder) (builder As TBuilder, endpointName As String) As TBuilder

類型參數

TBuilder

參數

builder
TBuilder

IEndpointConventionBuilder

endpointName
String

端點名稱。

傳回

TBuilder

IEndpointConventionBuilder

適用於