I am having issues with understanding how to make this happen.
Basically we have an API, the user sends a JSON of the format: (excuse the code if not perfect but you understand)
{"Profile": [{
"Name":"Joe",
"Last :"Doe",
"Client":
{
"ClientId":"1",
"Product":"Apple",
"Message":"Peter likes apples"
},
"Date":"2012-02-14",
}]}
Ok I'm not sure if I got that JSON formatted correctly but now here is my issue.
I have a class called Profile
with parameters Name, Last, and an object as one of its members called Client as well as property Date.
Something like this:
public class Profile
{
public string Name {get; set;}
public string Last {get; set;}
public Client client {get; set;}
public DateTime dDate {get; set;}
}
So basically, I am not sure how to grab the JSON and then map it to my object.
Any help with "helping" me understand would be much appreciated.
See Question&Answers more detail:os