Skip to content

Instantly share code, notes, and snippets.

@jmahc
Created February 26, 2019 18:48
Show Gist options
  • Save jmahc/015f68ff00674f584c4f45d62936e273 to your computer and use it in GitHub Desktop.
Save jmahc/015f68ff00674f584c4f45d62936e273 to your computer and use it in GitHub Desktop.
Example for walter
{
"objectOne": {
"id": 123,
"propertyOne": 4000,
"propertyTwo": "MyString"
},
"objectTwo": null
}
{
"objectOne": {
"id": 987,
"propertyOne": 123,
"propertyTwo": "Something"
},
"objectTwo": {
"id": 876
"differentPropertyOne": "12/25/2000T02:02:02",
"differentPropertyTwo": "Some phrase"
}
}
using Newtonsoft.Json;
namespace MyProject {
public class ExampleSchema
{
[JsonProperty("objetOne")
public ObjectOne ObjectOne {get; set;}
[JsonProperty("objetTwo")
public ObjectTwo ObjectOne {get; set;}
}
public class ObjectOne
{
[JsonProperty("id")]
public int Id { get; set; }
[JsonProperty("propertyOne")]
public string PropertyOne { get; set; }
[JsonProperty("propertyTwo")]
public string PropertyTwo { get; set; }
}
public class ObjectTwo
{
[JsonProperty("id")]
public int Id { get; set; }
[JsonProperty("differentPropertyOne")]
public DateTime DifferentPropertyOne { get; set; }
[JsonProperty("differentPropertyTwo")]
public string DifferentPropertyTwo { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment