I have this JSON response and I create an equivalent C# class. But when I try to convert this JSON to c# result not completed.
JSON Response
{
"result": "success",
"totalresults": 1,
"startnumber": 0,
"numreturned": 1,
"orders": {
"order": [
{
"id": 26,
"ordernum": 9658502986,
"userid": 18,
"frauddata": "",
"lineitems": {
"lineitem": [
{
"type": "domain",
"relid": 9,
"dnsmanagement": 0,
"emailforwarding": 0,
"idprotection": 0
}
]
}
}
]
}
}
C# Class
public class RootObject
{
int totalresults { get; set; }
int startnumber { get; set; }
int numreturned { get; set; }
orders orders { get; set; }
}
public class lineitem
{
public string type { get; set; }
public int idprotection { get; set; }
}
public class lineitems
{
public List<lineitem> lineitem { get; set; }
}
public class order
{
public int id { get; set; }
public long ordernum { get; set; }
public int userid { get; set; }
public string fraudmodule { get; set; }
public string fraudoutput { get; set; }
public string frauddata { get; set; }
public lineitems lineitems { get; set; }
}
public class orders
{
public List<order> order { get; set; }
}
I used JsonConvert.DeserializeObject but in result orders property always empty!
I need to orders property. Can anybody help me?