Example #1
0
 /// <summary>
 /// 反序列化
 /// </summary>
 /// <typeparam name="T">类型</typeparam>
 /// <param name="json">json数据</param>
 /// <returns>反序列化的类型</returns>
 public T Decode <T>(string json)
 {
     if (string.IsNullOrEmpty(json))
     {
         return(default(T));
     }
     return(adapter != null?adapter.Decode <T>(json) : default(T));
 }
Example #2
0
        public T Decode <T>(string json)
        {
            if (string.IsNullOrEmpty(json))
            {
                return(default(T));
            }

            if (jsonParse != null)
            {
                return(jsonParse.Decode <T>(json));
            }
            return(default(T));
        }