Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Property: IEqualityComparer<object> SerializationEqualityComparer

Declaration

IEqualityComparer<object> SerializationEqualityComparer

Summary

Provides a means to customize Classify’s definition of object equality, i.e. to control which objects are serialized as references to each other and which ones are duplicated in the serialized form.

Remarks

The default comparer treats all strings as different, thus causing them to be re-serialized each time even if they are in fact equal. All other objects are tested for reference equality. This way, object reference equality is preserved across serializing and deserializing.

An alternative may be, for example, to assign EqualityComparer<object>.Default here. This would treat objects as equal if they implement IEquatable<T> and deem each other as equal. Such a strategy would improve deduplication of information in the serialized form, but would cause the deserialized form to re-use object instances more than the original did.