Skip to content

Instantly share code, notes, and snippets.

@einarwh
Last active May 13, 2020 08:48
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/c704e2233f8c91903fc57f9e68b8b898 to your computer and use it in GitHub Desktop.
Save einarwh/c704e2233f8c91903fc57f9e68b8b898 to your computer and use it in GitHub Desktop.
Using a dictionary as serialization source model for a paid cart.
var paidCartBag = new Dictionary<string, object> {
{
"_state", "paid"
},
{
"paidItems",
new List<object>() {
new Dictionary<string, object> {
{ "id", "1bcd" },
{ "title", "gizmo" }
},
new Dictionary<string, object> {
{ "id", "3cdf" },
{ "title", "widget" },
{ "description", "A very useful item" }
}
}
},
{
"payment",
new Dictionary<string, object> {
{ "amount", 123.5 },
{ "currency", "USD" }
}
},
{
"timestamp", "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