RouteShortCircuitEndpointConventionBuilderExtensions.ShortCircuit 方法

定义

将终结点 () 短路。 终结点的执行将在 UseRouting 中间件而不是 UseEndpoint 中发生。

public static Microsoft.AspNetCore.Builder.IEndpointConventionBuilder ShortCircuit (this Microsoft.AspNetCore.Builder.IEndpointConventionBuilder builder, int? statusCode = default);
static member ShortCircuit : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder * Nullable<int> -> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder
<Extension()>
Public Function ShortCircuit (builder As IEndpointConventionBuilder, Optional statusCode As Nullable(Of Integer) = Nothing) As IEndpointConventionBuilder

参数

builder
IEndpointConventionBuilder

终结点约定生成器。

statusCode
Nullable<Int32>

在响应中设置的状态代码。

返回

原始约定生成器参数。

适用于