<PackageReference Include="System.ObjectModel" Version="4.0.11-beta-23409" />

ReadOnlyDictionary<TKey, TValue>

public class ReadOnlyDictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable, IDictionary, ICollection, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>
Represents a read-only, generic collection of key/value pairs.
public sealed class KeyCollection<TKey, TValue> : ICollection<TKey>, IEnumerable<TKey>, IEnumerable, ICollection, IReadOnlyCollection<TKey>

Represents a read-only collection of the keys of a ReadOnlyDictionary<T, U> object.

public sealed class ValueCollection<TKey, TValue> : ICollection<TValue>, IEnumerable<TValue>, IEnumerable, ICollection, IReadOnlyCollection<TValue>

Represents a read-only collection of the values of a ReadOnlyDictionary<T, U> object.

public int Count { get; }

Gets the number of items in the dictionary.

protected IDictionary<TKey, TValue> Dictionary { get; }

Gets the dictionary that is wrapped by this ReadOnlyDictionary<T, U> object.

public TValue this[TKey key] { get; }

Gets the element that has the specified key.

public KeyCollection<TKey, TValue> Keys { get; }

Gets a key collection that contains the keys of the dictionary.

public ValueCollection<TKey, TValue> Values { get; }

Gets a collection that contains the values in the dictionary.

public ReadOnlyDictionary(IDictionary<TKey, TValue> dictionary)

Initializes a new instance of the ReadOnlyDictionary<T, U> class that is a wrapper around the specified dictionary.

public bool ContainsKey(TKey key)

Determines whether the dictionary contains an element that has the specified key.

public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()

Returns an enumerator that iterates through the ReadOnlyDictionary<T, U>.

public bool TryGetValue(TKey key, out TValue value)

Retrieves the value that is associated with the specified key.