Пример #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);
        }
Пример #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);
     }
 }