

A variation of shopping cart DTOs that violate C# naming standards for propertie...
source link: https://gist.github.com/einarwh/bb4809047c366132374dae89ab6b5b43
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.
public abstract class ShoppingCart { public ShoppingCart(string state) { _state = state; }
public string _state { get; } }
public class EmptyCart : ShoppingCart { public EmptyCart() : base("empty") {} }
public class ActiveCart : ShoppingCart { public ActiveCart() : base("active") { } public Item[] unpaidItems { get; set; } }
public class PaidCart : ShoppingCart { public PaidCart() : base("paid") {} public object[] paidItems { get; set; } public Money payment { get; set; } public string timestamp { get; set; } }
public class Item { public string id { get; set; } public string title { get; set; } public string description { get; set; } }
public class Money { public float amount { get; set; } public string currency { get; set; } }
Recommend
-
152
Build a shopping cart with Vue.js and Element UI (no Vuex)In this tutorial we build a shopping cart with straight up Vue 2 (no Vuex) and style it using the Element UI vue component toolkit.
-
35
Crooks who hack online merchants to steal payment card data are constantly coming up with crafty ways to hide their malicious code on Web sites. In Internet ages past, this often meant obfuscating it as giant blobs of gib...
-
15
JSON representation of an empty shopping cart. · GitHub Instantly share code, notes, and snippets.
-
14
JSON representation of an active shopping cart. · GitHub Instantly share code, notes, and snippets.
-
13
A second variation of the shopping cart DTOs using custom attributes. · GitHub Instantly share code, notes, and snippets. A second variation of the s...
-
18
Serializing paid cart DTO variation 1 as JSON text. · GitHub Instantly share code, notes, and snippets. Serializing paid cart DTO variation 1 as JSON...
-
12
Ideal deserialization of shopping cart to DTO. · GitHub Instantly share code, notes, and snippets. Ideal deserialization of shopping cart to DTO.
-
15
Hard times ahead for shopping cart providers Dec 22, 2007 business
-
13
A third variation of the shopping cart DTO Instantly share code, notes, and snippets. A third variation of the shopping cart DTO - everything at once...
-
8
Material design style click effects with pointer events and CSS Custom Properties 13.01.2020 0 comments
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK