Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IImmutableDictionary<TKey, TValue> Interface

 

Represents an immutable collection of key/value pairs.

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

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

generic<typename TKey, typename TValue>
public interface class IImmutableDictionary : IReadOnlyDictionary<TKey, TValue>, 
	IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, 
	IEnumerable

Type Parameters

TKey

The type of keys in the dictionary.

TValue

The type of values in the dictionary.

NameDescription
System_CAPS_pubmethodAdd(TKey, TValue)

Adds an element with the specified key and value to the dictionary.

System_CAPS_pubmethodAddRange(IEnumerable<KeyValuePair<TKey, TValue>>^)

Adds the specified key/value pairs to the dictionary.

System_CAPS_pubmethodClear()

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

System_CAPS_pubmethodContains(KeyValuePair<TKey, TValue>)

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

System_CAPS_pubmethodContainsKey(TKey)
System_CAPS_pubmethodGetEnumerator()

(Inherited from IEnumerable<T>.)

System_CAPS_pubmethodRemove(TKey)

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

System_CAPS_pubmethodRemoveRange(IEnumerable<TKey>^)

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

System_CAPS_pubmethodSetItem(TKey, TValue)

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

System_CAPS_pubmethodSetItems(IEnumerable<KeyValuePair<TKey, TValue>>^)

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

System_CAPS_pubmethodTryGetKey(TKey, TKey%)

Determines whether this dictionary contains a specified key.

System_CAPS_pubmethodTryGetValue(TKey, TValue%)

NameDescription
System_CAPS_pubmethodToImmutableArray<KeyValuePair<TKey, TValue>>()

Creates an immutable array from the specified collection.(Defined by ImmutableArray.)

System_CAPS_pubmethodToImmutableDictionary<KeyValuePair<TKey, TValue>, TKey>(Func<KeyValuePair<TKey, TValue>, TKey>^)

Overloaded. Constructs an immutable dictionary from an existing collection of elements, applying a transformation function to the source keys.(Defined by ImmutableDictionary.)

System_CAPS_pubmethodToImmutableDictionary<KeyValuePair<TKey, TValue>, TKey>(Func<KeyValuePair<TKey, TValue>, TKey>^, IEqualityComparer<TKey>^)

Overloaded. Constructs an immutable dictionary based on some transformation of a sequence.(Defined by ImmutableDictionary.)

System_CAPS_pubmethodToImmutableDictionary<KeyValuePair<TKey, TValue>, TKey, TValue>(Func<KeyValuePair<TKey, TValue>, TKey>^, Func<KeyValuePair<TKey, TValue>, TValue>^)

Overloaded. Enumerates and transforms a sequence, and produces an immutable dictionary of its contents.(Defined by ImmutableDictionary.)

System_CAPS_pubmethodToImmutableDictionary<KeyValuePair<TKey, TValue>, TKey, TValue>(Func<KeyValuePair<TKey, TValue>, TKey>^, Func<KeyValuePair<TKey, TValue>, TValue>^, IEqualityComparer<TKey>^)

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

System_CAPS_pubmethodToImmutableDictionary<KeyValuePair<TKey, TValue>, TKey, TValue>(Func<KeyValuePair<TKey, TValue>, TKey>^, Func<KeyValuePair<TKey, TValue>, TValue>^, IEqualityComparer<TKey>^, IEqualityComparer<TValue>^)

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

System_CAPS_pubmethodToImmutableHashSet<KeyValuePair<TKey, TValue>>()

Overloaded. Enumerates a sequence and produces an immutable hash set of its contents.(Defined by ImmutableHashSet.)

System_CAPS_pubmethodToImmutableHashSet<KeyValuePair<TKey, TValue>>(IEqualityComparer<KeyValuePair<TKey, TValue>>^)

Overloaded. Enumerates a sequence, produces an immutable hash set of its contents, and uses the specified equality comparer for the set type.(Defined by ImmutableHashSet.)

System_CAPS_pubmethodToImmutableList<KeyValuePair<TKey, TValue>>()

Enumerates a sequence and produces an immutable list of its contents.(Defined by ImmutableList.)

System_CAPS_pubmethodToImmutableSortedDictionary<KeyValuePair<TKey, TValue>, TKey, TValue>(Func<KeyValuePair<TKey, TValue>, TKey>^, Func<KeyValuePair<TKey, TValue>, TValue>^)

Overloaded. Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents.(Defined by ImmutableSortedDictionary.)

System_CAPS_pubmethodToImmutableSortedDictionary<KeyValuePair<TKey, TValue>, TKey, TValue>(Func<KeyValuePair<TKey, TValue>, TKey>^, Func<KeyValuePair<TKey, TValue>, TValue>^, IComparer<TKey>^)

Overloaded. Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents by using the specified key comparer.(Defined by ImmutableSortedDictionary.)

System_CAPS_pubmethodToImmutableSortedDictionary<KeyValuePair<TKey, TValue>, TKey, TValue>(Func<KeyValuePair<TKey, TValue>, TKey>^, Func<KeyValuePair<TKey, TValue>, TValue>^, IComparer<TKey>^, IEqualityComparer<TValue>^)

Overloaded. Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents by using the specified key and value comparers.(Defined by ImmutableSortedDictionary.)

System_CAPS_pubmethodToImmutableSortedSet<KeyValuePair<TKey, TValue>>()

Overloaded. Enumerates a sequence and produces an immutable sorted set of its contents.(Defined by ImmutableSortedSet.)

System_CAPS_pubmethodToImmutableSortedSet<KeyValuePair<TKey, TValue>>(IComparer<KeyValuePair<TKey, TValue>>^)

Overloaded. Enumerates a sequence, produces an immutable sorted set of its contents, and uses the specified comparer.(Defined by ImmutableSortedSet.)

A IImmutableDictionary<TKey, TValue> requires an equality comparer implementation to determine if two keys are equal.

Return to top
Show:
© 2017 Microsoft