<PackageReference Include="System.Collections.Immutable" Version="11.0.0-preview.2.26159.112" />

System.Collections.Frozen.FrozenDictionary<TKey, TValue>

public abstract class FrozenDictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IDictionary, ICollection
Provides an immutable, read-only dictionary optimized for fast lookup and enumeration.
public struct AlternateLookup<TKey, TValue, TAlternateKey>

Provides a type that may be used to perform operations on a FrozenDictionary<T, U> using a TAlternateKey as a key instead of a TKey.

public struct Enumerator<TKey, TValue> : IEnumerator<KeyValuePair<TKey, TValue>>, IEnumerator, IDisposable

Enumerates the elements of a FrozenDictionary<T, U>.

public static FrozenDictionary<TKey, TValue> Empty { get; }

Gets an empty FrozenDictionary<T, U>.

public IEqualityComparer<TKey> Comparer { get; }

Gets the comparer used by this dictionary.

public int Count { get; }

Gets the number of key/value pairs contained in the dictionary.

public TValue& modreq(System.Runtime.InteropServices.InAttribute) this[TKey key] { get; }

Gets a reference to the value associated with the specified key.

public ImmutableArray<TKey> Keys { get; }

Gets a collection containing the keys in the dictionary.

public ImmutableArray<TValue> Values { get; }

Gets a collection containing the values in the dictionary.

public bool ContainsKey(TKey key)

Determines whether the dictionary contains the specified key.

public void CopyTo(KeyValuePair<TKey, TValue>[] destination, int destinationIndex)

Copies the elements of the dictionary to an array of type KeyValuePair<T, U>, starting at the specified destinationIndex.

public void CopyTo(Span<KeyValuePair<TKey, TValue>> destination)

Copies the elements of the dictionary to a span of type KeyValuePair<T, U>.

public AlternateLookup<TKey, TValue, TAlternateKey> GetAlternateLookup<TAlternateKey>()

Gets an instance of a type that may be used to perform operations on a FrozenDictionary<T, U> using a TAlternateKey as a key instead of a TKey.

public Enumerator<TKey, TValue> GetEnumerator()

Returns an enumerator that iterates through the dictionary.

public TValue& modreq(System.Runtime.InteropServices.InAttribute) GetValueRefOrNullRef(TKey key)

Gets either a reference to a TValue in the dictionary or a null reference if the key does not exist in the dictionary.

public bool TryGetAlternateLookup<TAlternateKey>(out AlternateLookup lookup)

public bool TryGetValue(TKey key, out TValue value)

Gets the value associated with the specified key.