0

我有一项服务以以下格式返回我的 json 数据: "[{\"Id\":3,\"Name\":\"name1\",\"Age\":30,\"Course\":\"course1\",\"SchoolName\":\"school1\",\"City\":\"city1\",\"Country\":\"country1\",\"BuildDate\":null}]"

但我认为这可能是我在客户处遇到问题的根源,因为我认为它应该更像:

"[{"Id":3,"Name":"name1","Age":30,"Course":"course1","SchoolName":"school1","City":"city1","Country":"country1","BuildDate":null}]"

我这样序列化:

string model = //mydata to serialize
string jsonStringToSend = new JavaScriptSerializer().Serialize(model);

我怎样才能解决这个问题?

更新

按照建议删除双重序列化后,我现在得到:

[{Id:3, Name:name1, Age:30, Course:course1, SchoolName:school1, City:city1, Country:country1, BuildDate:null}]

4

1 回答 1

0

\"用于转义"字符。如果它确实是这样打印的,那么您可能也在逃避\

于 2013-03-19T16:11:51.403 回答