Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ReadOnlyDictionary<TKey, TValue>.ContainsKey Method

.NET Framework 4.6 and 4.5

Determines whether the dictionary contains an element that has the specified key.

Namespace:  System.Collections.ObjectModel
Assemblies:   System.ObjectModel (in System.ObjectModel.dll)
  mscorlib (in mscorlib.dll)

public bool ContainsKey(
	TKey key
)

Parameters

key
Type: TKey

The key to locate in the dictionary.

Return Value

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

Implements

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

.NET Framework

Supported in: 4.6, 4.5

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8
Show:
© 2015 Microsoft