Created
February 26, 2019 18:48
-
-
Save jmahc/015f68ff00674f584c4f45d62936e273 to your computer and use it in GitHub Desktop.
Example for walter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"objectOne": { | |
"id": 123, | |
"propertyOne": 4000, | |
"propertyTwo": "MyString" | |
}, | |
"objectTwo": null | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"objectOne": { | |
"id": 987, | |
"propertyOne": 123, | |
"propertyTwo": "Something" | |
}, | |
"objectTwo": { | |
"id": 876 | |
"differentPropertyOne": "12/25/2000T02:02:02", | |
"differentPropertyTwo": "Some phrase" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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