Exemple #1
0
 /// <summary>
 /// 将 <see cref="string"/>(JSON) 转换到指定对象
 /// </summary>
 /// <param name="value"><see cref="string"/>(JSON) 值</param>
 /// <param name="sets">反序列化设置</param>
 /// <returns></returns>
 public static T YusToObject <T>(this string value, Swifter.Json.JsonFormatterOptions sets = Swifter.Json.JsonFormatterOptions.Default)
 {
     return(Yus.Serialization.YusJson.ToObject <T>(value, sets: sets));
 }
Exemple #2
0
 /// <summary>
 /// 转换为 JSON
 /// </summary>
 /// <param name="obj">要序列化的对象</param>
 /// <param name="sets">序列化设置</param>
 /// <returns></returns>
 public static string YusToJson(this object obj, Swifter.Json.JsonFormatterOptions sets = Swifter.Json.JsonFormatterOptions.Default)
 {
     return(obj.YusIsNull() ? null : YusJson.ToJson(obj, sets: sets));
 }