System.Collections.Immutable by Microsoft

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

.NET API 247,456 bytes

 IImmutableDictionary<TKey, TValue>

public interface IImmutableDictionary<TKey, TValue> : IReadOnlyDictionary<TKey, TValue>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable, IReadOnlyCollection<KeyValuePair<TKey, TValue>>
Represents an immutable collection of key/value pairs. NuGet package: System.Collections.Immutable (about immutable collections and how to install)
IImmutableDictionary<TKey, TValue> Add(TKey key, TValue value)

Adds an element with 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()

Retrieves an empty dictionary that has the same ordering and key/value comparison rules as this dictionary instance.

bool Contains(KeyValuePair<TKey, TValue> pair)

Determines whether the immutable dictionary contains the specified key/value pair.

IImmutableDictionary<TKey, TValue> Remove(TKey key)

Removes the element with the specified key from the immutable dictionary.

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

Removes the elements with the specified keys from the immutable dictionary.

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

Sets the specified key and value in the immutable dictionary, possibly overwriting an existing value for the key.

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

Sets the specified key/value pairs in the immutable dictionary, possibly overwriting existing values for the keys.

bool TryGetKey(TKey equalKey, out TKey actualKey)

Determines whether this dictionary contains a specified key.