✅ Struggling to use custom comparer with a list of KeyValuePairs
I'm trying to sort a list of keyvaluepairs on the key. I've defined an IComparer using Comparer.Create, but the list after sorting is identical to before. I can't use a SortedList because that requires unique keys.
The output looks like
Whereas I'd expect it to be sorted in either ascending or descending order.
The output looks like
Whereas I'd expect it to be sorted in either ascending or descending order.