1
以下id我的一段代码,它反序列化Json字符串。不能反序列化Json数组到类型字符串
response = "{\"success\":\"yes\",\"error\":\"\",\"message\":\"\",\"arguments\":[{\"id\":\"72820\",\"rowNo\":\"1\",\"userId\":\"40\",\"entityId\":\"3486\",\"value\":\"search Panel\",\"typeCategory\":\"3\"}]}";
erpAPIResponse basicResponse = JsonConvert.DeserializeObject<erpAPIResponse>(response);
结果是被反序列化到erpAPIResponse中的JSON字符串。
我erpAPIResponse如下:
public string success { get; set; } // getting and setting the success
public string error { get; set; } // getting and setting the error
public string message { get; set; } // getting and setting the message
public string arguments { get; set; } // getting and setting the arguments
// public string result { get; set; }
我必须通过JSON林特验证JSON和跟它它是有效的JSON字符串。那么为什么我得到这个错误?
我已经试过你的代码,但仍没有运气 –
我想在字符串中的参数,然后我将再次反序列化 –
我已成功反序列化上面的代码。你能否指出你卡住的具体错误? –