Exemplo n.º 1
0
        public Lemonade RemoveLemonadeBasket(Lemonade lemonadeOutBasket)
        {
            Lemonade outLemonade;

            outLemonade = Lemonades.FirstOrDefault(l => l.Name == lemonadeOutBasket.Name);
            if (outLemonade != null)
            {
                Lemonades.Remove(lemonadeOutBasket);
            }
            return(outLemonade);
        }
Exemplo n.º 2
0
 public void AddLemonadeBasket(Lemonade lemonadeToBasket)
 {
     if (TotalBasket() < MaxItems)
     {
         Lemonades.Add(lemonadeToBasket);
     }
     else
     {
         Console.WriteLine("Basket is full and I couldn't add " + lemonadeToBasket.Name);
     }
 }