public SerializeObject ( |
||
writer | ||
instance | object | |
info | IJsonSerializeOperationInfo | |
return | void |
public void SerializeObject(JsonWriter writer, object instance, IJsonSerializeOperationInfo info) { var jsonObject = (JsonObject)instance; writer.WriteOpenObject(); var first = true; foreach (var item in jsonObject) { if (first) { first = false; } else { writer.WriteItemSeparator(); } writer.WriteValue(item.Key); writer.WriteNameValueSeparator(); _dynamicJsonSerializer.SerializeObject(writer, item.Value, info); } writer.WriteCloseObject(); }
public void SerializeObject(JsonWriter writer, object instance, IJsonSerializeOperationInfo info) { var jsonArray = (JsonArray)instance; writer.WriteOpenArray(); var first = true; foreach (var item in jsonArray) { if (first) { first = false; } else { writer.WriteItemSeparator(); } _dynamicJsonSerializer.SerializeObject(writer, item, info); } writer.WriteCloseArray(); }