private static string SerializeObjectInternal(object value, Type type, JsonSerializer jsonSerializer) { StringBuilder sb = new StringBuilder(256); StringWriter sw = new StringWriter(sb, CultureInfo.InvariantCulture); using (DsonWriter dsonWriter = new DsonWriter(sw)) { dsonWriter.Formatting = jsonSerializer.Formatting; jsonSerializer.Serialize(dsonWriter, value, type); } return(sw.ToString()); }
private static string SerializeObjectInternal(object value, Type type, JsonSerializer jsonSerializer) { StringBuilder sb = new StringBuilder(256); StringWriter sw = new StringWriter(sb, CultureInfo.InvariantCulture); using (DsonWriter dsonWriter = new DsonWriter(sw)) { dsonWriter.Formatting = jsonSerializer.Formatting; jsonSerializer.Serialize(dsonWriter, value, type); } return sw.ToString(); }