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

ReadOnlyDictionary<TKey, TValue>

public class ReadOnlyDictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, ICollection, IEnumerable
Provides the base class for a generic read-only dictionary.
public int Count { get; }

Gets the number of key/value pairs contained in the ReadOnlyDictionary<T, U>.

public TValue this[TKey key] { get; set; }

Gets or sets the value associated with the specified key.

public ICollection<TKey> Keys { get; }

Gets a collection containing the keys in the ReadOnlyDictionary{TKey,TValue}.

public ICollection<TValue> Values { get; }

Gets a collection containing the values of the ReadOnlyDictionary<T, U>.

public ReadOnlyDictionary(IDictionary<TKey, TValue> values)

Initializes a new instance of the ReadOnlyDictionary<T, U> class that wraps the supplied values.

public bool ContainsKey(TKey key)

Determines whether the ReadOnlyDictionary<T, U> contains the specified key.

public bool TryGetValue(TKey key, out TValue value)

Gets the value associated with the specified key.