PollyServiceCollectionExtensions.AddPolicyRegistry 方法
定義
多載
AddPolicyRegistry(IServiceCollection) |
使用服務類型 Polly.Registry.IPolicyRegistry`1 和 Polly.Registry.IReadOnlyPolicyRegistry`1 在服務集合中註冊空白 Polly.Registry.PolicyRegistry,並傳回新建立的登錄。Registers an empty Polly.Registry.PolicyRegistry in the service collection with service types Polly.Registry.IPolicyRegistry`1, and Polly.Registry.IReadOnlyPolicyRegistry`1 and returns the newly created registry. |
AddPolicyRegistry(IServiceCollection, IPolicyRegistry<String>) |
使用服務類型 Polly.Registry.IPolicyRegistry`1 和 Polly.Registry.IReadOnlyPolicyRegistry`1 在服務集合中註冊所提供的 Polly.Registry.IPolicyRegistry`1,並傳回所提供的登錄。Registers the provided Polly.Registry.IPolicyRegistry`1 in the service collection with service types Polly.Registry.IPolicyRegistry`1, and Polly.Registry.IReadOnlyPolicyRegistry`1 and returns the provided registry. |
AddPolicyRegistry(IServiceCollection)
使用服務類型 Polly.Registry.IPolicyRegistry`1 和 Polly.Registry.IReadOnlyPolicyRegistry`1 在服務集合中註冊空白 Polly.Registry.PolicyRegistry,並傳回新建立的登錄。Registers an empty Polly.Registry.PolicyRegistry in the service collection with service types Polly.Registry.IPolicyRegistry`1, and Polly.Registry.IReadOnlyPolicyRegistry`1 and returns the 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)
參數
- services
- IServiceCollection
傳回
新建立的 Polly.Registry.PolicyRegistry。The newly created Polly.Registry.PolicyRegistry.
AddPolicyRegistry(IServiceCollection, IPolicyRegistry<String>)
使用服務類型 Polly.Registry.IPolicyRegistry`1 和 Polly.Registry.IReadOnlyPolicyRegistry`1 在服務集合中註冊所提供的 Polly.Registry.IPolicyRegistry`1,並傳回所提供的登錄。Registers the provided Polly.Registry.IPolicyRegistry`1 in the service collection with service types Polly.Registry.IPolicyRegistry`1, and Polly.Registry.IReadOnlyPolicyRegistry`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)
參數
- services
- IServiceCollection
- registry
- Polly.Registry.IPolicyRegistry<String>
Polly.Registry.IPolicyRegistry`1。The Polly.Registry.IPolicyRegistry`1.
傳回
提供的 Polly.Registry.IPolicyRegistry`1。The provided Polly.Registry.IPolicyRegistry`1.