Skip to content

Instantly share code, notes, and snippets.

@dcomartin

dcomartin/Entity.cs Secret

Created Feb 10, 2021
Embed
What would you like to do?
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