For some really irritating reason, the JsonProperty tags are not working with Newtonsoft's Json for .net tool. In my class I have these:
[JsonProperty(PropertyName = "id")]
public string ID { get; set; }
[JsonProperty(PropertyName = "title")]
public string Title { get; set; }
[JsonProperty(PropertyName = "url")]
public string Url { get; set; }
[JsonProperty(PropertyName = "class")]
public string EventClass { get; set; }
[JsonProperty(PropertyName = "start")]
public string Start { get; set; }
[JsonProperty(PropertyName = "end")]
public string End { get; set; }
But I am receiving this
{"success":true,
"result": [{
"ID":"0",
"Title":"Eid ul-Fitr",
"Url":"<blah>",
"EventClass":"event-info",
"Start":"1406520000000",
"End":"1406606400000"},
etc.
As you can see it is ignoring me setting the property name. I have tried using [System.Runtime.Serialization.DataMember(Name="id")]
as well and that has not worked.
Here is what is really driving me up the wall. It worked yesterday. I rolled it back to where it was last night when I committed and it still won't work.
Any thoughts?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…