我有以下JSON数据,需要进行反序列化。顺便说一下,我正在使用C#并尝试以下操作:
// the data has been assigned to json variable
Result deserializedResult = JsonConvert.DeserializeObject<Result>(json);
结果类
private String _id = String.Empty;
private String[] _result = { };
private String _error = String.Empty;
public Result()
{
}
public String id
{
get { return _id; }
set { _id = value; }
}
public String[] result
{
get { return _result; }
set { _result = value; }
}
public String error
{
get { return _error; }
set { _error = value; }
}
JSon
{"id":1,"result":
[
{"id":12345,
"list_id":54321,
"is_test":false,
"type":"manual",
"creator_name":"Test Solutions"
},
{"id":54321,
"list_id":12345,
"is_test":false,
"type":"manual",
"creator_name":"Test Solutions"
}
],
"error":null}
错误
Additional information: Error reading string. Unexpected token: StartObject. Path 'result[0]', line 1, position 19.