public List<COB_BurnInPostTest> JsonToModels(string JsonData)
{
List<COB_BurnInPostTest> jobInfoList = new List<COB_BurnInPostTest> { };
try
{
var obj = JsonConvert.DeserializeObject(JsonData);
if (obj is JArray) //判断是否为Json数组
{
jobInfoList = JsonConvert.DeserializeObject<List<COB_BurnInPostTest>>(JsonData); //json数组转为对象
}
else
{
COB_BurnInPostTest jobInfoList1 = JsonConvert.DeserializeObject<COB_BurnInPostTest>(JsonData); //json数据转为实体类
jobInfoList.Add(jobInfoList1);
}
}
catch (Exception ex)
{
}
return jobInfoList;
}