Skip to content

Instantly share code, notes, and snippets.

@eulerfx
Created April 25, 2012 04:24
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 eulerfx/2486326 to your computer and use it in GitHub Desktop.
Save eulerfx/2486326 to your computer and use it in GitHub Desktop.
Order Model
public class Order
{
public string Id { get; private set; }
public string Number { get; private set; }
public string CustomerId { get; private set; }
public DateTime Date { get; private set; }
public ICollection<OrderLineItem> Items { get; private set; }
public decimal ShippingCharge { get; private set; }
public decimal TaxCharge { get; private set; }
public decimal Total
{
get { return this.Items.Sum(x => x.TotalPrice) + this.ShippingCharge + this.TaxCharge; }
}
}
public class OrderLineItem
{
public Product Product { get; private set; }
public decimal Price { get; private set; }
public int Quantity { get; private set; }
public decimal TotalPrice
{
get { return this.Price * this.Quantity; }
}
}
public class Product
{
public string Id { get; private set; }
public string Brand { get; private set; }
public string ModelNumber { get; private set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment