Class AddResiliencePipelinesContext<TKey>
- Namespace
- Polly.DependencyInjection
- Assembly
- Polly.Extensions.dll
Represents the context for configuring resilience pipelines with the specified key.
public sealed class AddResiliencePipelinesContext<TKey> where TKey : notnull
Type Parameters
TKey
The type of the key used to identify the resilience pipeline.
- Inheritance
-
AddResiliencePipelinesContext<TKey>
- Inherited Members
Properties
ServiceProvider
Gets the IServiceProvider that provides access to the dependency injection container.
public IServiceProvider ServiceProvider { get; }
Property Value
Methods
AddResiliencePipeline(TKey, Action<ResiliencePipelineBuilder, AddResiliencePipelineContext<TKey>>)
Adds a resilience pipeline to the registry.
public void AddResiliencePipeline(TKey key, Action<ResiliencePipelineBuilder, AddResiliencePipelineContext<TKey>> configure)
Parameters
key
TKeyThe key used to identify the resilience pipeline.
configure
Action<ResiliencePipelineBuilder, AddResiliencePipelineContext<TKey>>An action that configures the resilience pipeline.
Remarks
You can retrieve the registered pipeline by resolving the ResiliencePipelineProvider<TKey> class from the dependency injection container.
This call enables telemetry for the registered resilience pipeline.
AddResiliencePipeline<TResult>(TKey, Action<ResiliencePipelineBuilder<TResult>, AddResiliencePipelineContext<TKey>>)
Adds a resilience pipeline to the registry.
public void AddResiliencePipeline<TResult>(TKey key, Action<ResiliencePipelineBuilder<TResult>, AddResiliencePipelineContext<TKey>> configure)
Parameters
key
TKeyThe key used to identify the resilience pipeline.
configure
Action<ResiliencePipelineBuilder<TResult>, AddResiliencePipelineContext<TKey>>An action that configures the resilience pipeline.
Type Parameters
TResult
The type of result that the resilience pipeline handles.
Remarks
You can retrieve the registered pipeline by resolving the ResiliencePipelineProvider<TKey> class from the dependency injection container.
This call enables telemetry for the registered resilience pipeline.