Export (0) Print
Expand All

ImmutableDictionary Class

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

NuGet package: Microsoft.Bcl.Immutable (about immutable collections and how to install)

System.Object
  System.Collections.Immutable.ImmutableDictionary

Namespace:  System.Collections.Immutable
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

public static class ImmutableDictionary

The ImmutableDictionary type exposes the following members.

  NameDescription
Public methodStatic memberContains<TKey, TValue>Determines whether the specified immutable dictionary contains the specified key/value pair.
Public methodStatic memberCreate<TKey, TValue>()Creates an empty immutable dictionary.
Public methodStatic memberCreate<TKey, TValue>(IEqualityComparer<TKey>)Creates an empty immutable dictionary that uses the specified key comparer.
Public methodStatic memberCreate<TKey, TValue>(IEqualityComparer<TKey>, IEqualityComparer<TValue>)Creates an empty immutable dictionary that uses the specified key and value comparers.
Public methodStatic memberCreateBuilder<TKey, TValue>()Creates a new immutable dictionary builder.
Public methodStatic memberCreateBuilder<TKey, TValue>(IEqualityComparer<TKey>)Creates a new immutable dictionary builder.
Public methodStatic memberCreateBuilder<TKey, TValue>(IEqualityComparer<TKey>, IEqualityComparer<TValue>)Creates a new immutable dictionary builder.
Public methodStatic memberCreateRange<TKey, TValue>(IEnumerable<KeyValuePair<TKey, TValue>>)Creates a new immutable dictionary that contains the specified items.
Public methodStatic memberCreateRange<TKey, TValue>(IEqualityComparer<TKey>, IEnumerable<KeyValuePair<TKey, TValue>>)Creates a new immutable dictionary that contains the specified items and uses the specified key comparer.
Public methodStatic memberCreateRange<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.
Public methodStatic memberGetValueOrDefault<TKey, TValue>(IImmutableDictionary<TKey, TValue>, TKey)Gets the value for a given key if a matching key exists in the dictionary.
Public methodStatic memberGetValueOrDefault<TKey, TValue>(IImmutableDictionary<TKey, TValue>, TKey, TValue)Gets the value for a given key if a matching key exists in the dictionary.
Public methodStatic memberToImmutableDictionary<TKey, TValue>(IEnumerable<KeyValuePair<TKey, TValue>>)Enumerates a sequence of key/value pairs and produces an immutable dictionary of its contents.
Public methodStatic memberToImmutableDictionary<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.
Public methodStatic memberToImmutableDictionary<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.
Public methodStatic memberToImmutableDictionary<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.
Public methodStatic memberToImmutableDictionary<TSource, TKey>(IEnumerable<TSource>, Func<TSource, TKey>, IEqualityComparer<TKey>)Constructs an immutable dictionary based on some transformation of a sequence.
Public methodStatic memberToImmutableDictionary<TSource, TKey, TValue>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TSource, TValue>)Enumerates and transforms a sequence, and produces an immutable dictionary of its contents.
Public methodStatic memberToImmutableDictionary<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.
Public methodStatic memberToImmutableDictionary<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.
Top

This type is thread safe.

Show:
© 2014 Microsoft