Why does Json.Net call the Equals method on my objects when serializing?
问题 I just ran into an error when I was using the Newtonsoft.Json SerializeObject method. It has been asked before here, but there was no answer from the people working with Newtonsoft as to why this happens. Basically, when calling SerializeObject like this: string json = Newtonsoft.Json.JsonConvert.SerializeObject(from, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All }); I get errors in a lot of Equals methods I have overridden in my classes: public override bool Equals