PollyServiceCollectionExtensions.AddPolicyRegistry Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| AddPolicyRegistry(IServiceCollection) |
Registers an empty PolicyRegistry in the service collection with service types IPolicyRegistry<TKey>, IReadOnlyPolicyRegistry<TKey>, and Polly.Registry.IConcurrentPolicyRegistry`1 if the service types haven't already been registered and returns the existing or newly created registry. |
| AddPolicyRegistry(IServiceCollection, IPolicyRegistry<String>) |
Registers the provided IPolicyRegistry<TKey> in the service collection with service types IPolicyRegistry<TKey>, IReadOnlyPolicyRegistry<TKey>, and Polly.Registry.IConcurrentPolicyRegistry`1 and returns the provided registry. |
| AddPolicyRegistry(IServiceCollection, Action<IServiceProvider,IPolicyRegistry<String>>) |
Registers an empty PolicyRegistry in the service collection with service types IPolicyRegistry<TKey>, IReadOnlyPolicyRegistry<TKey>, and Polly.Registry.IConcurrentPolicyRegistry`1 and uses the specified delegate to configure it. |
AddPolicyRegistry(IServiceCollection)
Registers an empty PolicyRegistry in the service collection with service types IPolicyRegistry<TKey>, IReadOnlyPolicyRegistry<TKey>, and Polly.Registry.IConcurrentPolicyRegistry`1 if the service types haven't already been registered and returns the existing or newly created registry.
public:
[System::Runtime::CompilerServices::Extension]
static Polly::Registry::IPolicyRegistry<System::String ^> ^ AddPolicyRegistry(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Polly.Registry.IPolicyRegistry<string> AddPolicyRegistry(this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddPolicyRegistry : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Polly.Registry.IPolicyRegistry<string>
<Extension()>
Public Function AddPolicyRegistry (services As IServiceCollection) As IPolicyRegistry(Of String)
Parameters
- services
- IServiceCollection
The IServiceCollection.
Returns
The existing or newly created IPolicyRegistry<TKey>.
Applies to
AddPolicyRegistry(IServiceCollection, IPolicyRegistry<String>)
Registers the provided IPolicyRegistry<TKey> in the service collection with service types IPolicyRegistry<TKey>, IReadOnlyPolicyRegistry<TKey>, and Polly.Registry.IConcurrentPolicyRegistry`1 and returns the provided registry.
public:
[System::Runtime::CompilerServices::Extension]
static Polly::Registry::IPolicyRegistry<System::String ^> ^ AddPolicyRegistry(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Polly::Registry::IPolicyRegistry<System::String ^> ^ registry);
public static Polly.Registry.IPolicyRegistry<string> AddPolicyRegistry(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Polly.Registry.IPolicyRegistry<string> registry);
static member AddPolicyRegistry : Microsoft.Extensions.DependencyInjection.IServiceCollection * Polly.Registry.IPolicyRegistry<string> -> Polly.Registry.IPolicyRegistry<string>
<Extension()>
Public Function AddPolicyRegistry (services As IServiceCollection, registry As IPolicyRegistry(Of String)) As IPolicyRegistry(Of String)
Parameters
- services
- IServiceCollection
The IServiceCollection.
- registry
- IPolicyRegistry<String>
Returns
The provided IPolicyRegistry<TKey>.
Applies to
AddPolicyRegistry(IServiceCollection, Action<IServiceProvider,IPolicyRegistry<String>>)
Registers an empty PolicyRegistry in the service collection with service types IPolicyRegistry<TKey>, IReadOnlyPolicyRegistry<TKey>, and Polly.Registry.IConcurrentPolicyRegistry`1 and uses the specified delegate to configure it.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddPolicyRegistry(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<IServiceProvider ^, Polly::Registry::IPolicyRegistry<System::String ^> ^> ^ configureRegistry);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddPolicyRegistry(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<IServiceProvider,Polly.Registry.IPolicyRegistry<string>> configureRegistry);
static member AddPolicyRegistry : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<IServiceProvider, Polly.Registry.IPolicyRegistry<string>> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddPolicyRegistry (services As IServiceCollection, configureRegistry As Action(Of IServiceProvider, IPolicyRegistry(Of String))) As IServiceCollection
Parameters
- services
- IServiceCollection
The IServiceCollection.
- configureRegistry
- Action<IServiceProvider,IPolicyRegistry<String>>
A delegate that is used to configure an IPolicyRegistry<TKey>.
Returns
The provided IServiceCollection.