Method Contains
Contains(KeyValuePair<TKey, TValue>, IEqualityComparer<TValue>?)
Determines whether the dictionary contains the specified key and value pair.
Declaration
public bool Contains(KeyValuePair<TKey, TValue> kvp, IEqualityComparer<TValue>? comparer = null)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<TKey, TValue> | kvp | The key and value pair to locate. |
| IEqualityComparer<TValue> | comparer | The comparer to use to determine equality of the values, or null to use the default comparer. |
Returns
| Type | Description |
|---|---|
| bool |
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The dictionary has been disposed. |
Contains(TKey, TValue, IEqualityComparer<TValue>?)
Determines whether the dictionary contains the specified key with a value equal to the specified value.
Declaration
public bool Contains(TKey key, TValue value, IEqualityComparer<TValue>? comparer = null)
Parameters
| Type | Name | Description |
|---|---|---|
| TKey | key | The key to locate. |
| TValue | value | The value to locate. |
| IEqualityComparer<TValue> | comparer | The comparer to use to determine equality of the values, or null to use the default comparer. |
Returns
| Type | Description |
|---|---|
| bool |
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The dictionary has been disposed. |