Beispiel #1
0
        public static T Decode <T>(this string json)
        {
            if (string.IsNullOrEmpty(json))
            {
                return(default(T));
            }
            object jsonObj = JsonParser.ParseValue(json);

            if (jsonObj == null)
            {
                return(default(T));
            }
            return(JsonMapper.DecodeJsonObject <T>(jsonObj));
        }
Beispiel #2
0
        public static T Decode <T>(this string json)
        {
            if (string.IsNullOrEmpty(json))
            {
                return(default(T));
            }
            object jsonObj = JsonParser.ParseValue(json);

            if (jsonObj == null)
            {
                return(default(T));
            }
            T obj = JsonMapper.DecodeJsonObject <T>(jsonObj);

            TypeExtensions.typeToProperties.Clear();
            return(obj);
        }