Export (0) Print
Expand All

ImmutableDictionary<TKey, TValue>.TryGetValue Method

Gets the value associated with the specified key.

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

public bool TryGetValue(
	TKey key,
	out TValue value
)

Parameters

key
Type: TKey

The key whose value will be retrieved.

value
Type: TValue

When this method returns, contains the value associated with the specified key, if the key is found; otherwise, contains the default value for the type of the value parameter. This parameter is passed uninitialized.

Return Value

Type: System.Boolean
true if the object that implements the dictionary contains an element with the specified key; otherwise, false.

Implements

IReadOnlyDictionary<TKey, TValue>.TryGetValue(TKey, TValue)
IDictionary<TKey, TValue>.TryGetValue(TKey, TValue)

ExceptionCondition
ArgumentNullException

key is null.

Show:
© 2014 Microsoft