解析值后,遇到意外字符:“。路径'[0]问题

时间:2016-09-07 08:53:58

标签: json deserialization filepath backslash

我在从文件路径反序列化json时遇到错误。

来自Model的我的json模型是(Model.GroupsJson)所以:

[{\"GroupContent\":\"<p><img alt=\"\" src=\"http://localhost:56502/images/uploads/1471441332_flat-style-circle-add.png\" style=\"height:32px; width:32px\" /></p>\n\",\"Questions\":[{\"QuestionId\":\"57c3de87b6455e070800df0d\",\"Order\":\"0\"},{\"QuestionId\":\"57c91f85b6455e13b0646e7d\",\"Order\":\"0\"},{\"QuestionId\":\"57c8317ab6455e08b47ad839\",\"Order\":\"0\"}]},{\"GroupContent\":\"<p>aaaa</p>\n\",\"Questions\":[{\"QuestionId\":\"57c7d4bfb6455e1a08f17a3a\",\"Order\":\"1\"},{\"QuestionId\":\"57c3d753b6455e1840ccf8b5\",\"Order\":\"1\"}]}]

之后我尝试反序列化json模型:

List<GroupModel> groupList = JsonConvert.DeserializeObject<List<GroupModel>>(model.GroupsJSON)

然后这个异常抛出:

附加信息:解析值后,遇到意外字符:“。路径'[0] .GroupContent',第1行,第31位。

我该怎么办?我应该在模型上编码反斜杠字符吗?

0 个答案:

没有答案