public void ToJson(TextWriter writer, object value, Type type, bool formatted) { var deconstructor = typeSerializer.GetDeconstructor(type); deconstructor.Deconstruct(value, new JsonOutput(writer, formatted, maxSerializeGraphDepth)); }