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

System.Collections.Immutable.ImmutableDictionary

public static class ImmutableDictionary
Provides a set of initialization methods for instances of the ImmutableDictionary<T, U> class. NuGet package: System.Collections.Immutable (about immutable collections and how to install)
namespace System.Collections.Immutable { public static class ImmutableDictionary { public static ImmutableDictionary<TKey, TValue> Create<TKey, [Nullable(2)] TValue>(); public static ImmutableDictionary<TKey, TValue> Create<TKey, [Nullable(2)] TValue>(IEqualityComparer<TKey> keyComparer); public static ImmutableDictionary<TKey, TValue> Create<TKey, [Nullable(2)] TValue>(IEqualityComparer<TKey> keyComparer, IEqualityComparer<TValue> valueComparer); public static ImmutableDictionary<TKey, TValue> CreateRange<TKey, [Nullable(2)] TValue>(IEnumerable<KeyValuePair<TKey, TValue>> items); public static ImmutableDictionary<TKey, TValue> CreateRangeWithOverwrite<TKey, [Nullable(2)] TValue>(ReadOnlySpan<KeyValuePair<TKey, TValue>> items); public static ImmutableDictionary<TKey, TValue> CreateRange<TKey, [Nullable(2)] TValue>(IEqualityComparer<TKey> keyComparer, IEnumerable<KeyValuePair<TKey, TValue>> items); public static ImmutableDictionary<TKey, TValue> CreateRangeWithOverwrite<TKey, [Nullable(2)] TValue>(IEqualityComparer<TKey> keyComparer, ReadOnlySpan<KeyValuePair<TKey, TValue>> items); public static ImmutableDictionary<TKey, TValue> CreateRange<TKey, [Nullable(2)] TValue>(IEqualityComparer<TKey> keyComparer, IEqualityComparer<TValue> valueComparer, IEnumerable<KeyValuePair<TKey, TValue>> items); public static ImmutableDictionary<TKey, TValue>.Builder CreateBuilder<TKey, [Nullable(2)] TValue>(); public static ImmutableDictionary<TKey, TValue>.Builder CreateBuilder<TKey, [Nullable(2)] TValue>(IEqualityComparer<TKey> keyComparer); public static ImmutableDictionary<TKey, TValue>.Builder CreateBuilder<TKey, [Nullable(2)] TValue>(IEqualityComparer<TKey> keyComparer, IEqualityComparer<TValue> valueComparer); public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<[Nullable(2)] TSource, TKey, [Nullable(2)] TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey> keyComparer, IEqualityComparer<TValue> valueComparer); public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, [Nullable(2)] TValue>(this ImmutableDictionary<TKey, TValue>.Builder builder); public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<[Nullable(2)] TSource, TKey, [Nullable(2)] TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey> keyComparer); public static ImmutableDictionary<TKey, TSource> ToImmutableDictionary<[Nullable(2)] TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector); public static ImmutableDictionary<TKey, TSource> ToImmutableDictionary<[Nullable(2)] TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> keyComparer); public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<[Nullable(2)] TSource, TKey, [Nullable(2)] TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector); public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, [Nullable(2)] TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source, IEqualityComparer<TKey> keyComparer, IEqualityComparer<TValue> valueComparer); public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, [Nullable(2)] TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source, IEqualityComparer<TKey> keyComparer); public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, [Nullable(2)] TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source); public static bool Contains<TKey, [Nullable(2)] TValue>(this IImmutableDictionary<TKey, TValue> map, TKey key, TValue value); public static TValue GetValueOrDefault<TKey, [Nullable(2)] TValue>(this IImmutableDictionary<TKey, TValue> dictionary, TKey key); public static TValue GetValueOrDefault<TKey, [Nullable(2)] TValue>(this IImmutableDictionary<TKey, TValue> dictionary, TKey key, TValue defaultValue); } }