Skip to content

Instantly share code, notes, and snippets.

@einarwh
Last active May 13, 2020 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save einarwh/0eaeaed367ace428fe6a7459f20956f6 to your computer and use it in GitHub Desktop.
Save einarwh/0eaeaed367ace428fe6a7459f20956f6 to your computer and use it in GitHub Desktop.
A paid shopping cart serialized using Newtonsoft's JSON data model.
var paidCartObject = new JObject(
new JProperty("_state", new JValue("paid")),
new JProperty("paidItems",
new JArray(
new JObject(
new JProperty("id", new JValue("1bcd")),
new JProperty("title", new JValue("gizmo"))),
new JObject(
new JProperty("id", new JValue("3cdf")),
new JProperty("title", new JValue("widget")),
new JProperty("description", new JValue("A very useful item"))))),
new JProperty("payment",
new JObject(
new JProperty("amount", new JValue(123.5)),
new JProperty("currency", new JValue("USD")))),
new JProperty("timestamp", new JValue("2020-04-11T10:11:33.514+02:00")));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment