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

IReadOnlyPolicyRegistry<TKey>

public interface IReadOnlyPolicyRegistry<TKey>
Represents a read-only collection of policies keyed by TKey.
int Count { get; }

Total number of policies in the registry.

IsPolicy this[TKey key] { get; }

Gets 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.

bool ContainsKey(TKey key)

Determines whether the specified key exists.

TPolicy Get<TPolicy>(TKey key) where TPolicy : IsPolicy

Gets the policy stored under the provided key, casting to TPolicy.

bool TryGet<TPolicy>(TKey key, out TPolicy policy) where TPolicy : IsPolicy

Gets the policy stored under the provided key, casting to TPolicy.