Edit

Kongsi melalui


ImmutableDictionary Class

Definition

Provides a set of initialization methods for instances of the ImmutableDictionary<TKey,TValue> class.

NuGet package: System.Collections.Immutable (about immutable collections and how to install)

public ref class ImmutableDictionary abstract sealed
public static class ImmutableDictionary
type ImmutableDictionary = class
Public Module ImmutableDictionary
Inheritance
ImmutableDictionary

Methods

Contains<TKey,TValue>(IImmutableDictionary<TKey,TValue>, TKey, TValue)

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

Create<TKey,TValue>()

Creates an empty immutable dictionary.

Create<TKey,TValue>(IEqualityComparer<TKey>, IEqualityComparer<TValue>)

Creates an empty immutable dictionary that uses the specified key and value comparers.

Create<TKey,TValue>(IEqualityComparer<TKey>)

Creates an empty immutable dictionary that uses the specified key comparer.

CreateBuilder<TKey,TValue>()

Creates a new immutable dictionary builder.

CreateBuilder<TKey,TValue>(IEqualityComparer<TKey>, IEqualityComparer<TValue>)

Creates a new immutable dictionary builder.

CreateBuilder<TKey,TValue>(IEqualityComparer<TKey>)

Creates a new immutable dictionary builder.

CreateRange<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>)

Creates a new immutable dictionary that contains the specified items.

CreateRange<TKey,TValue>(IEqualityComparer<TKey>, IEnumerable<KeyValuePair<TKey,TValue>>)

Creates a new immutable dictionary that contains the specified items and uses the specified key comparer.

CreateRange<TKey,TValue>(IEqualityComparer<TKey>, IEqualityComparer<TValue>, IEnumerable<KeyValuePair<TKey,TValue>>)

Creates a new immutable dictionary that contains the specified items and uses the specified key comparer.

GetValueOrDefault<TKey,TValue>(IImmutableDictionary<TKey,TValue>, TKey, TValue)

Gets the value for a given key if a matching key exists in the dictionary.

GetValueOrDefault<TKey,TValue>(IImmutableDictionary<TKey,TValue>, TKey)

Gets the value for a given key if a matching key exists in the dictionary.

ToImmutableDictionary<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>, IEqualityComparer<TKey>, IEqualityComparer<TValue>)

Enumerates a sequence of key/value pairs and produces an immutable dictionary of its contents by using the specified key and value comparers.

ToImmutableDictionary<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>, IEqualityComparer<TKey>)

Enumerates a sequence of key/value pairs and produces an immutable dictionary of its contents by using the specified key comparer.

ToImmutableDictionary<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>)

Enumerates a sequence of key/value pairs and produces an immutable dictionary of its contents.

ToImmutableDictionary<TKey,TValue>(ImmutableDictionary<TKey,TValue>.Builder)

Creates an immutable dictionary from the current contents of the builder's dictionary.

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>, IEqualityComparer<TValue>)

Enumerates and transforms a sequence, and produces an immutable dictionary of its contents by using the specified key and value comparers.

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>)

Enumerates and transforms a sequence, and produces an immutable dictionary of its contents by using the specified key comparer.

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

Enumerates and transforms a sequence, and produces an immutable dictionary of its contents.

ToImmutableDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Constructs an immutable dictionary based on some transformation of a sequence.

ToImmutableDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

Constructs an immutable dictionary from an existing collection of elements, applying a transformation function to the source keys.

Applies to

Thread Safety

This type is thread safe.