所以我有一组课程:
public class CallQueueRequest
{
public string ACK { get; set; }
public string ERROR { get; set; }
public Agent AGENT { get; set; }
public Skill SKILL { get; set; }
public string TIME { get; set; }
}
public class Agent
{
public string has_result { get; set; }
public List<Agents> agents { get; set; }
}
public class Agents
{
public string display_name { get; set; }
public string time_in_state { get; set; }
public string state { get; set; }
public string callstakentoday { get; set; }
public string avaya_skill_num { get; set; }
}
public class Skill
{
public string has_result { get; set; }
public string num_skills { get; set; }
public List<Skills> skills { get; set; }
}
public class Skills
{
public string display_name { get; set; }
public string avaya_skill_num { get; set; }
public string callsinqueue { get; set; }
public string callstoday { get; set; }
public string abantoday { get; set; }
public string lwt { get; set; }
public string ewt { get; set; }
public string servicelvl { get; set; }
public string avgspeedans { get; set; }
public string talktime { get; set; }
}
我有这个Json:
{
"ACK":"SUCCESS",
"ERROR":null,
"AGENT":{
"has_results":1,
"agents":[
{
"display_name":"John Doe",
"time_in_state":"378",
"state":"Acd",
"callstakentoday":null,
"avaya_skill_num":"81"
},
{
"display_name":"Jane Joe",
"time_in_state":"220",
"state":"Acd",
"callstakentoday":null,
"avaya_skill_num":"81"
}
]
},
"SKILL":{
"has_results":1,
"num_skills":1,
"skills":[
{
"display_name":"QueueName",
"avaya_skill_num":"81",
"callsinqueue":"1",
"callstoday":"29",
"abandtoday":"1",
"lwt":"74",
"ewt":"223",
"servicelvl":"86",
"avgspeedans":"35",
"talktime":"873"
}
]
},
"TIME":1355864270
}
我正在使用这段代码:
object qr = JsonConvert.DeserializeObject(jsonString);
这似乎没有正确地从 Json 转换为复杂的类。有人可以帮助我吗?我认为这只是一个小错误。