ConcurrentDictionary<TKey, TValue>.TryGetValue Method (TKey, TValue)

.NET Framework (current version)
 

Attempts to get the value associated with the specified key from the System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.

Namespace:   System.Collections.Concurrent
Assembly:  mscorlib (in mscorlib.dll)

public bool TryGetValue(
	TKey key,
	out TValue value
)

Parameters

key
Type: TKey

The key of the value to get.

value
Type: TValue

When this method returns, contains the object from the System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue> that has the specified key, or the default value of the type if the operation failed.

Return Value

Type: System.Boolean

true if the key was found in the System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>; otherwise, false.

Exception Condition
ArgumentNullException

key is null.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top
Show: