Skip to content

Instantly share code, notes, and snippets.

@copypastedeveloper
Created October 10, 2013 03:43
Show Gist options
  • Select an option

  • Save copypastedeveloper/6912714 to your computer and use it in GitHub Desktop.

Select an option

Save copypastedeveloper/6912714 to your computer and use it in GitHub Desktop.
public class Customer
{
public decimal AccountBalance { get; set; }
public List<Orders> Orders { get; set; }
public string Name { get; set; }
public void AddMoney(decimal amountToAdd)
{
AccountBalance += amountToAdd
}
public void PlaceOrder(string iceCreamFlavor, decimal price)
{
if (AccountBalance >= price)
{
AccountBalance-=price;
Orders.Add(new Order { Flavor = iceCreamFlavor });
return;
}
throw new InsufficientFundsException();
}
}
public class Order
{
public string Flavor { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment