RoutingEndpointConventionBuilderExtensions.WithName<TBuilder> 方法

定义

IEndpointNameMetadata在给定 的情况下,将 添加到在目标IEndpointConventionBuilder上生成的所有终结点的元数据集合。endpointName IEndpointNameMetadata终结点上的 用于链接生成,在给定终结点的 OpenAPI 规范中被视为操作 ID。

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

适用于