Exemplo n.º 1
0
 /// <summary>
 /// serialization an object to JSON string by IJsonSerializer
 /// </summary>
 /// <typeparam name="T">data type</typeparam>
 /// <param name="obj">data object</param>
 /// <param name="jsonSerializeSetting">JsonSerializeSetting</param>
 /// <returns>Json string</returns>
 public static string ObjectToJson <T>(T obj, JsonSerializeSetting jsonSerializeSetting)
 {
     return(jsonSerializer.ObjectToJson(obj, jsonSerializeSetting));
 }
Exemplo n.º 2
0
 /// <summary>
 /// deserialization a json string to an object by IJsonSerializer
 /// </summary>
 /// <param name="json">json string</param>
 /// <param name="jsonSerializeSetting">JsonSerializeSetting</param>
 /// <returns>data object</returns>
 public static T JsonToObject <T>(string json, JsonSerializeSetting jsonSerializeSetting)
 {
     return(jsonSerializer.JsonToObject <T>(json, jsonSerializeSetting));
 }