Class EntryValueComparer<TKey, TValue>
Represents a KeyValuePair<TKey, TValue> comparer, where the result only relies on the comparison result between the values.
public sealed class EntryValueComparer<TKey, TValue> : IKeyValuePairComparer<TKey, TValue>, IComparer<KeyValuePair<TKey, TValue>> where TValue : IComparable<TValue>
Type Parameters
TKeyThe type of the key.
TValueThe type of the value.
- Inheritance
-
EntryValueComparer<TKey, TValue>
- Implements
-
IKeyValuePairComparer<TKey, TValue>IComparer<KeyValuePair<TKey, TValue>>
- Inherited Members
- Extension Methods
Fields
Default
The default instance of the EntryValueComparer<TKey, TValue> class.
public static readonly EntryValueComparer<TKey, TValue> Default
Field Value
- EntryValueComparer<TKey, TValue>
Methods
Compare(KeyValuePair<TKey, TValue>, KeyValuePair<TKey, TValue>)
Compares two KeyValuePair<TKey, TValue> instances given this comparer's rules.
public int Compare(KeyValuePair<TKey, TValue> left, KeyValuePair<TKey, TValue> right)
Parameters
leftKeyValuePair<TKey, TValue>The left value to compare.
rightKeyValuePair<TKey, TValue>The right value to compare.
Returns
- int
The comparison result between the values. For the comparison, order is matched.