System.Collections.Immutable by Microsoft

<PackageReference Include="System.Collections.Immutable" Version="8.0.0-preview.2.23128.3" />

.NET API 249,992 bytes

 IImmutableDictionary<TKey, TValue>

public interface IImmutableDictionary<TKey, TValue> : IReadOnlyDictionary<TKey, TValue>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable, IReadOnlyCollection<KeyValuePair<TKey, TValue>>
An immutable key-value dictionary.
IImmutableDictionary<TKey, TValue> Add(TKey key, TValue value)

Adds the specified key and value to the dictionary.

IImmutableDictionary<TKey, TValue> AddRange(IEnumerable<KeyValuePair<TKey, TValue>> pairs)

Adds the specified key-value pairs to the dictionary.

IImmutableDictionary<TKey, TValue> Clear()

Gets an empty dictionary with equivalent ordering and key/value comparison rules.

bool Contains(KeyValuePair<TKey, TValue> pair)

Determines whether this dictionary contains the specified key-value pair.

IImmutableDictionary<TKey, TValue> Remove(TKey key)

Removes the specified key from the dictionary with its associated value.

IImmutableDictionary<TKey, TValue> RemoveRange(IEnumerable<TKey> keys)

Removes the specified keys from the dictionary with their associated values.

IImmutableDictionary<TKey, TValue> SetItem(TKey key, TValue value)

Sets the specified key and value to the dictionary, possibly overwriting an existing value for the given key.

IImmutableDictionary<TKey, TValue> SetItems(IEnumerable<KeyValuePair<TKey, TValue>> items)

Applies a given set of key=value pairs to an immutable dictionary, replacing any conflicting keys in the resulting dictionary.

bool TryGetKey(TKey equalKey, out TKey actualKey)

Searches the dictionary for a given key and returns the equal key it finds, if any.