Method TryGetValue
TryGetValue(TKey, out TValue?)
Gets the value associated with the specified key.
Declaration
public bool TryGetValue(TKey key, out TValue? value)
Parameters
| Type | Name | Description |
|---|---|---|
| TKey | key | The key of the value to get. |
| TValue | value | When this method returns, contains the value associated with the key if it was found and is still available; otherwise null. |
Returns
| Type | Description |
|---|---|
| bool | true if the key was found and its value is still available; otherwise false. |
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The dictionary has been disposed. |