<PackageReference Include="Polly" Version="5.6.0" />

IPolicyRegistry<TKey>

public interface IPolicyRegistry<TKey> : IReadOnlyPolicyRegistry<TKey>
Represents a collection of policies keyed by TKey.
IsPolicy this[TKey key] { get; set; }

Gets or sets the IsPolicy with the specified key. To retrieve a policy directly as a particular Policy type or Policy interface (avoiding a cast), use the Get<T> method.

void Add<TPolicy>(TKey key, TPolicy policy) where TPolicy : IsPolicy

Adds an element with the provided key and policy to the registry.

void Clear()

Removes all keys and policies from registry.

bool Remove(TKey key)

Removes the specified Policy from the registry.