Serialization of anonymous paid cart DTO to JSON text.
source link: https://gist.github.com/einarwh/a09410f1b3004b1b7dfe34a51e6b8010
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Instantly share code, notes, and snippets.
var paidCartAnon = new { _state = "paid", paidItems = new object[] { new { id = "1bcd", title = "gizmo" }, new { id = "3cdf", title = "widget", description = "A very useful item" } }, payment = new { mount = 123.5, currency = "USD" }, timestamp = "2020-04-11T10:11:33.514+02:00" };
var paidCartAnonJsonText = JsonConvert.SerializeObject(paidCartAnon);
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK