Skip to content

Instantly share code, notes, and snippets.

@einarwh
Last active May 13, 2020 17:52
Show Gist options
  • Save einarwh/afba5ff3e2ba244fc4de4499f2261704 to your computer and use it in GitHub Desktop.
Save einarwh/afba5ff3e2ba244fc4de4499f2261704 to your computer and use it in GitHub Desktop.
Serializing paid cart DTO variation 1 as JSON text.
var paidCartDto1 = new PaidCart
{
paidItems = new Item[] {
new Item {
id = "1bcd",
title = "gizmo"
},
new Item {
id = "3cdf",
title = "widget",
description = "A very useful item"
}
},
payment = new Money {
mount = 123.5,
currency = "USD"
},
timestamp = "2020-04-11T10:11:33.514+02:00"
};
var paidCartDto1JsonText = JsonConvert.SerializeObject(paidCartDto1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment