共用方式為


ResilienceHttpClientBuilderExtensions.AddResilienceHandler 方法

定義

多載

AddResilienceHandler(IHttpClientBuilder, String, Action<ResiliencePipelineBuilder<HttpResponseMessage>,ResilienceHandlerContext>)

新增使用具名內嵌復原管線的復原管線處理程式。

AddResilienceHandler(IHttpClientBuilder, String, Action<ResiliencePipelineBuilder<HttpResponseMessage>>)

新增使用具名內嵌復原管線的復原管線處理程式。

AddResilienceHandler(IHttpClientBuilder, String, Action<ResiliencePipelineBuilder<HttpResponseMessage>,ResilienceHandlerContext>)

來源:
ResilienceHttpClientBuilderExtensions.Resilience.cs

新增使用具名內嵌復原管線的復原管線處理程式。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Http::Resilience::IHttpResiliencePipelineBuilder ^ AddResilienceHandler(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, System::String ^ pipelineName, Action<Polly::ResiliencePipelineBuilder<System::Net::Http::HttpResponseMessage ^> ^, Microsoft::Extensions::Http::Resilience::ResilienceHandlerContext ^> ^ configure);
public static Microsoft.Extensions.Http.Resilience.IHttpResiliencePipelineBuilder AddResilienceHandler (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, string pipelineName, Action<Polly.ResiliencePipelineBuilder<System.Net.Http.HttpResponseMessage>,Microsoft.Extensions.Http.Resilience.ResilienceHandlerContext> configure);
static member AddResilienceHandler : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * string * Action<Polly.ResiliencePipelineBuilder<System.Net.Http.HttpResponseMessage>, Microsoft.Extensions.Http.Resilience.ResilienceHandlerContext> -> Microsoft.Extensions.Http.Resilience.IHttpResiliencePipelineBuilder
<Extension()>
Public Function AddResilienceHandler (builder As IHttpClientBuilder, pipelineName As String, configure As Action(Of ResiliencePipelineBuilder(Of HttpResponseMessage), ResilienceHandlerContext)) As IHttpResiliencePipelineBuilder

參數

builder
IHttpClientBuilder

產生器實例。

pipelineName
String

復原管線的自定義標識碼,用於管線的名稱。

傳回

builder 的值。

備註

最後的管線名稱是 和pipelineName的組合Name。 如果您的 HTTP 用戶端包含多個復原處理程式,請使用管線名稱識別碼。

適用於

AddResilienceHandler(IHttpClientBuilder, String, Action<ResiliencePipelineBuilder<HttpResponseMessage>>)

來源:
ResilienceHttpClientBuilderExtensions.Resilience.cs

新增使用具名內嵌復原管線的復原管線處理程式。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Http::Resilience::IHttpResiliencePipelineBuilder ^ AddResilienceHandler(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, System::String ^ pipelineName, Action<Polly::ResiliencePipelineBuilder<System::Net::Http::HttpResponseMessage ^> ^> ^ configure);
public static Microsoft.Extensions.Http.Resilience.IHttpResiliencePipelineBuilder AddResilienceHandler (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, string pipelineName, Action<Polly.ResiliencePipelineBuilder<System.Net.Http.HttpResponseMessage>> configure);
static member AddResilienceHandler : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * string * Action<Polly.ResiliencePipelineBuilder<System.Net.Http.HttpResponseMessage>> -> Microsoft.Extensions.Http.Resilience.IHttpResiliencePipelineBuilder
<Extension()>
Public Function AddResilienceHandler (builder As IHttpClientBuilder, pipelineName As String, configure As Action(Of ResiliencePipelineBuilder(Of HttpResponseMessage))) As IHttpResiliencePipelineBuilder

參數

builder
IHttpClientBuilder

產生器實例。

pipelineName
String

復原管線的自定義標識碼,用於管線的名稱。

configure
Action<ResiliencePipelineBuilder<HttpResponseMessage>>

設定管線的回呼。

傳回

builder 的值。

備註

最後的管線名稱是 和pipelineName的組合Name。 如果您的 HTTP 用戶端包含多個復原處理程式,請使用管線名稱識別碼。

適用於