RequestTimeoutOptions.AddPolicy 方法

定义

重载

AddPolicy(String, RequestTimeoutPolicy)

添加新策略。

AddPolicy(String, TimeSpan)

添加新策略。

AddPolicy(String, RequestTimeoutPolicy)

Source:
RequestTimeoutOptions.cs

添加新策略。

public Microsoft.AspNetCore.Http.Timeouts.RequestTimeoutOptions AddPolicy (string policyName, Microsoft.AspNetCore.Http.Timeouts.RequestTimeoutPolicy policy);
member this.AddPolicy : string * Microsoft.AspNetCore.Http.Timeouts.RequestTimeoutPolicy -> Microsoft.AspNetCore.Http.Timeouts.RequestTimeoutOptions
Public Function AddPolicy (policyName As String, policy As RequestTimeoutPolicy) As RequestTimeoutOptions

参数

policyName
String

策略的名称 (不区分大小写) 。

policy
RequestTimeoutPolicy

RequestTimeoutPolicy 添加的策略。

返回

适用于

AddPolicy(String, TimeSpan)

Source:
RequestTimeoutOptions.cs

添加新策略。

public Microsoft.AspNetCore.Http.Timeouts.RequestTimeoutOptions AddPolicy (string policyName, TimeSpan timeout);
member this.AddPolicy : string * TimeSpan -> Microsoft.AspNetCore.Http.Timeouts.RequestTimeoutOptions
Public Function AddPolicy (policyName As String, timeout As TimeSpan) As RequestTimeoutOptions

参数

policyName
String

策略的名称 (不区分大小写) 。

timeout
TimeSpan

要应用于此策略的超时。

返回

适用于