Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created February 10, 2021 22:34
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 dcomartin/b5967107de977cfc1047c34d163aba7e to your computer and use it in GitHub Desktop.
Save dcomartin/b5967107de977cfc1047c34d163aba7e to your computer and use it in GitHub Desktop.
public class ShoppingCart
{
public ShoppingCart(Guid shoppingCartId, Guid customerId)
{
ShoppingCartId = shoppingCartId;
CustomerId = customerId;
}
public Guid ShoppingCartId { get; private set; }
public Guid CustomerId { get; private set; }
public IList<ShoppingCartItem> Items { get; set; } = new List<ShoppingCartItem>();
}
public class ShoppingCartItem
{
public ShoppingCartItem(Guid shoppingCartId, Guid productId, int quantity, decimal price)
{
ShoppingCartId = shoppingCartId;
ProductId = productId;
Quantity = quantity;
Price = price;
}
public Guid ShoppingCartId { get; set; }
public Guid ProductId { get; private set; }
public int Quantity { get; set; }
public decimal Price { get; private set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment