共用方式為


PollyHttpClientBuilderExtensions.AddPolicyHandlerFromRegistry 方法

定義

多載

AddPolicyHandlerFromRegistry(IHttpClientBuilder, Func<IReadOnlyPolicyRegistry<String>,HttpRequestMessage,IAsyncPolicy<HttpResponseMessage>>)

新增會以 IReadOnlyPolicyRegistry<TKey> 所傳回原則括住要求執行的 PolicyHttpMessageHandler

AddPolicyHandlerFromRegistry(IHttpClientBuilder, String)

新增會以 IReadOnlyPolicyRegistry<TKey> 所傳回原則括住要求執行的 PolicyHttpMessageHandler

AddPolicyHandlerFromRegistry(IHttpClientBuilder, Func<IReadOnlyPolicyRegistry<String>,HttpRequestMessage,IAsyncPolicy<HttpResponseMessage>>)

新增會以 IReadOnlyPolicyRegistry<TKey> 所傳回原則括住要求執行的 PolicyHttpMessageHandler

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddPolicyHandlerFromRegistry(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, Func<Polly::Registry::IReadOnlyPolicyRegistry<System::String ^> ^, System::Net::Http::HttpRequestMessage ^, Polly::IAsyncPolicy<System::Net::Http::HttpResponseMessage ^> ^> ^ policySelector);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddPolicyHandlerFromRegistry (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, Func<Polly.Registry.IReadOnlyPolicyRegistry<string>,System.Net.Http.HttpRequestMessage,Polly.IAsyncPolicy<System.Net.Http.HttpResponseMessage>> policySelector);
static member AddPolicyHandlerFromRegistry : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * Func<Polly.Registry.IReadOnlyPolicyRegistry<string>, System.Net.Http.HttpRequestMessage, Polly.IAsyncPolicy<System.Net.Http.HttpResponseMessage>> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function AddPolicyHandlerFromRegistry (builder As IHttpClientBuilder, policySelector As Func(Of IReadOnlyPolicyRegistry(Of String), HttpRequestMessage, IAsyncPolicy(Of HttpResponseMessage))) As IHttpClientBuilder

參數

傳回

可以用於設定用戶端的 IHttpClientBuilder

備註

如需設定原則的指引,請參閱的備註 PolicyHttpMessageHandler

適用於

AddPolicyHandlerFromRegistry(IHttpClientBuilder, String)

新增會以 IReadOnlyPolicyRegistry<TKey> 所傳回原則括住要求執行的 PolicyHttpMessageHandler

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddPolicyHandlerFromRegistry(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, System::String ^ policyKey);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddPolicyHandlerFromRegistry (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, string policyKey);
static member AddPolicyHandlerFromRegistry : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * string -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function AddPolicyHandlerFromRegistry (builder As IHttpClientBuilder, policyKey As String) As IHttpClientBuilder

參數

policyKey
String

用於從 IReadOnlyPolicyRegistry<TKey> 解析原則的索引鍵。

傳回

可以用於設定用戶端的 IHttpClientBuilder

備註

如需設定原則的指引,請參閱的備註 PolicyHttpMessageHandler

適用於