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.

ImmutableDictionary<TKey, TValue>::TryGetKey Method (TKey, TKey%)

 

Determines whether this dictionary contains a specified key.

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

public:
virtual bool TryGetKey(
	TKey equalKey,
	[OutAttribute] TKey% actualKey
) sealed

Parameters

equalKey
Type: TKey

The key to search for.

actualKey
Type: TKey%

The matching key located in the dictionary if found, or equalkey if no match is found.

Return Value

Type: System::Boolean

true if a match for equalKey is found; otherwise, false.

Following are some scenarios where TryGetKey may be useful:

  • You want to reuse a previously stored object reference instead of creating a new reference.

  • You want to look up the canonical value of an object

  • You want to retrieve more complete data about an object

Return to top
Show:
© 2017 Microsoft