Last active
May 13, 2020 08:48
-
-
Save einarwh/c704e2233f8c91903fc57f9e68b8b898 to your computer and use it in GitHub Desktop.
Using a dictionary as serialization source model for a paid cart.
This file contains 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
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