My JSON file
[
{
"amount":"1000000.0",
"check_number":1,
"payment_number":5,
"attachments":[
{
"id":5324,
"url":"http://www.example.com/",
"filename":"january_receipt_copy.jpg"
}
]
}
]
My Class File
public class Attachment
{
public int id { get; set; }
public string url { get; set; }
public string filename { get; set; }
}
public class AccountDetail
{
public string amount { get; set; }
public int check_number { get; set; }
public int payment_number { get; set; }
}
public class RootObject
{
public AccountDetail accountdetail{ get; set; }
public List<Attachment> attachments { get; set; }
}
Now I want to map JSON file's properties 'check_number','amount' etc
to accountdetail by using newtonsoft JSON deserialization.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…