Closed ychenming closed 3 years ago
JsonSerializer.cs: private Dictionary<Type, object> _defaults = new Dictionary<Type, object>(); if (_params.SerializeNullValues == false && (o == null || o is DBNull)) { //append = false; } else { // add start if (!_params.SerializeDefaultValues && o.GetType().IsValueType) { object def; if (!_defaults.TryGetValue(o.GetType(), out def)) { def = _defaults[o.GetType()] = Activator.CreateInstance(o.GetType()); } if (o.Equals(def)) continue; } // add end if (append) _output.Append(',');
??
JsonSerializer.cs: private Dictionary<Type, object> _defaults = new Dictionary<Type, object>(); if (_params.SerializeNullValues == false && (o == null || o is DBNull)) { //append = false; } else { // add start if (!_params.SerializeDefaultValues && o.GetType().IsValueType) { object def; if (!_defaults.TryGetValue(o.GetType(), out def)) { def = _defaults[o.GetType()] = Activator.CreateInstance(o.GetType()); } if (o.Equals(def)) continue; } // add end if (append) _output.Append(',');