PollyHttpClientBuilderExtensions.AddPolicyHandlerFromRegistry メソッド

定義

オーバーロード

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

Polly.Registry.IReadOnlyPolicyRegistry`1 から返されるポリシーを含む要求の実行を囲む PolicyHttpMessageHandler を追加します。Adds a PolicyHttpMessageHandler which will surround request execution with a policy returned by the Polly.Registry.IReadOnlyPolicyRegistry`1.

AddPolicyHandlerFromRegistry(IHttpClientBuilder, String)

Polly.Registry.IReadOnlyPolicyRegistry`1 から返されるポリシーを含む要求の実行を囲む PolicyHttpMessageHandler を追加します。Adds a PolicyHttpMessageHandler which will surround request execution with a policy returned by the Polly.Registry.IReadOnlyPolicyRegistry`1.

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

Polly.Registry.IReadOnlyPolicyRegistry`1 から返されるポリシーを含む要求の実行を囲む PolicyHttpMessageHandler を追加します。Adds a PolicyHttpMessageHandler which will surround request execution with a policy returned by the Polly.Registry.IReadOnlyPolicyRegistry`1.

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

パラメーター

policySelector
Func<Polly.Registry.IReadOnlyPolicyRegistry<String>,HttpRequestMessage,Polly.IAsyncPolicy<HttpResponseMessage>>

現在の要求に適用する Polly.IAsyncPolicy`1 を選択します。Selects an Polly.IAsyncPolicy`1 to apply to the current request.

戻り値

IHttpClientBuilder

クライアントを構成するために使用できる IHttpClientBuilderAn IHttpClientBuilder that can be used to configure the client.

注釈

ポリシーの構成については、「」の「解説」を参照してください PolicyHttpMessageHandlerSee the remarks on PolicyHttpMessageHandler for guidance on configuring policies.

AddPolicyHandlerFromRegistry(IHttpClientBuilder, String)

Polly.Registry.IReadOnlyPolicyRegistry`1 から返されるポリシーを含む要求の実行を囲む PolicyHttpMessageHandler を追加します。Adds a PolicyHttpMessageHandler which will surround request execution with a policy returned by the Polly.Registry.IReadOnlyPolicyRegistry`1.

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

Polly.Registry.IReadOnlyPolicyRegistry`1 からのポリシーを解決するために使用するキー。The key used to resolve a policy from the Polly.Registry.IReadOnlyPolicyRegistry`1.

戻り値

IHttpClientBuilder

クライアントを構成するために使用できる IHttpClientBuilderAn IHttpClientBuilder that can be used to configure the client.

注釈

ポリシーの構成については、「」の「解説」を参照してください PolicyHttpMessageHandlerSee the remarks on PolicyHttpMessageHandler for guidance on configuring policies.

適用対象