Created
April 25, 2012 04:24
-
-
Save eulerfx/2486326 to your computer and use it in GitHub Desktop.
Order Model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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