Skip to content

Instantly share code, notes, and snippets.

@einarwh
Last active May 12, 2020 23:19
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/3adcb5a2408572b0d7e381a5496722fb to your computer and use it in GitHub Desktop.
Save einarwh/3adcb5a2408572b0d7e381a5496722fb to your computer and use it in GitHub Desktop.
A third variation of the shopping cart DTO - everything at once!
class ShoppingCart
{
[JsonProperty("_state")]
public string State { get; set; }
[JsonProperty("unpaidItems", NullValueHandling = NullValueHandling.Ignore)]
public Item[] UnpaidItems { get; set; }
[JsonProperty("paidItems", NullValueHandling = NullValueHandling.Ignore)]
public Item[] PaidItems { get; set; }
[JsonProperty("payment", NullValueHandling = NullValueHandling.Ignore)]
public Money Payment { get; set; }
[JsonProperty("timestamp", NullValueHandling = NullValueHandling.Ignore)]
public string Timestamp { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment