Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Prepare data for unittests. Deserialize JSON to object hierarchy. Take from http://stackoverflow.com/a/9988494/443366
void Main()
{
JsonConvert.DeserializeObject<Root>(testJson).Dump();
}
readonly string testJson =
"{\"Profile\": [{" +
" \"Name\":\"Joe\"," +
" \"Last\":\"Doe\"," +
" \"Client\":" +
" {" +
" \"ClientId\":\"1\"," +
" \"Product\":\"Apple\"," +
" \"Message\":\"Peter likes apples\"" +
" }," +
" \"Date\":\"2012-02-14\"" +
" }]" +
"}";
public class Root
{
public Profile[] Profile;
}
public class Profile
{
public string Name { get; set; }
public string Last { get; set; }
public Client Client { get; set; }
public DateTime Date { get; set; }
}
public class Client
{
public int ClientId;
public string Product;
public string Message;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.