I want to serialize a Dictionary that has a custom IEqualityComparer
.
I've tried using DataContractSerializer
but I can't get the Comparer
to be serialized.
I can't use BinaryFormatter
because of this.
I can always do something like:
var myDictionary = new MyDictionary(deserializedDictionary, myComparer);
But that means I'd need twice the memory the dictionary uses.