PollyServiceCollectionExtensions.AddPolicyRegistry 方法
定义
重载
| AddPolicyRegistry(IServiceCollection) |
在服务集合中使用服务类型 IPolicyRegistry<TKey> 和 IReadOnlyPolicyRegistry<TKey> 注册空的 PolicyRegistry,并返回新创建的注册表。Registers an empty PolicyRegistry in the service collection with service types IPolicyRegistry<TKey>, and IReadOnlyPolicyRegistry<TKey> and returns the newly created registry. |
| AddPolicyRegistry(IServiceCollection, IPolicyRegistry<String>) |
在服务集合中使用服务类型 IPolicyRegistry<TKey> 和 IReadOnlyPolicyRegistry<TKey> 注册提供的 IPolicyRegistry<TKey>,并返回提供的注册表。Registers the provided IPolicyRegistry<TKey> in the service collection with service types IPolicyRegistry<TKey>, and IReadOnlyPolicyRegistry<TKey> and returns the provided registry. |
AddPolicyRegistry(IServiceCollection)
在服务集合中使用服务类型 IPolicyRegistry<TKey> 和 IReadOnlyPolicyRegistry<TKey> 注册空的 PolicyRegistry,并返回新创建的注册表。Registers an empty PolicyRegistry in the service collection with service types IPolicyRegistry<TKey>, and IReadOnlyPolicyRegistry<TKey> 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
返回
新创建的 PolicyRegistry。The newly created PolicyRegistry.
适用于
AddPolicyRegistry(IServiceCollection, IPolicyRegistry<String>)
在服务集合中使用服务类型 IPolicyRegistry<TKey> 和 IReadOnlyPolicyRegistry<TKey> 注册提供的 IPolicyRegistry<TKey>,并返回提供的注册表。Registers the provided IPolicyRegistry<TKey> in the service collection with service types IPolicyRegistry<TKey>, and IReadOnlyPolicyRegistry<TKey> 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
- IPolicyRegistry<String>
返回
提供的 IPolicyRegistry<TKey>。The provided IPolicyRegistry<TKey>.