Skip to content

Instantly share code, notes, and snippets.

@einarwh
Last active May 13, 2020 17:53
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/0bd17a2c7c824cf2a1a072c3dd088a2d to your computer and use it in GitHub Desktop.
Save einarwh/0bd17a2c7c824cf2a1a072c3dd088a2d to your computer and use it in GitHub Desktop.
Serialization of paid cart DTO v2 to JSON text.
var paidCartDto2 = 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 paidCartDto2JsonText = JsonConvert.SerializeObject(paidCartDto2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment