我有这样一个json字符串
[{"SessionId":"29066","TdpId":"11503","Version":"20170221120614","FromSystem":"Itap","RegistrationDataModels":[{"RegistrationID: ":"11328176","TestStatus: ":"2","ScoreStatus: ":"22","RejectedReason: ":"52","StageStatus: ":"0"},{"RegistrationID: ":"11371732","TestStatus: ":"2","ScoreStatus: ":"22","RejectedReason: ":"52","StageStatus: ":"0"},{"RegistrationID: ":"11374823","TestStatus: ":"2","ScoreStatus: ":"22","RejectedReason: ":"52","StageStatus: ":"0"},{"RegistrationID: ":"11382592","TestStatus: ":"5","ScoreStatus: ":"12","RejectedReason: ":"24","StageStatus: ":"0"}]}]
把它序列化为一个model
我的model是这样的
public int SessionId { get; set; } public int TdpId { get; set; } public long Version { get; set; } public string FromSystem { get; set; } public List<RegistrationDataModel> RegistrationDataModels { get; set; } [Serializable] public class RegistrationDataModel { public string RegistrationID { get; set; } public string TestStatus { get; set; } public string ScoreStatus { get; set; } public string RejectedReason { get; set; } public string StageStatus { get; set; } }
可是为什么序列化后的数据,在RegistrationDataModel中的属性都为 null?
我是这样序列化的
Newtonsoft.Json.JsonConvert.DeserializeObject<T>(json);
跪求,是我哪里写错了吗?
是我json写错了。
是要