Example #1
0
        private OrderLine AddProduct(string productName)
        {
            OrderLine orderLine = GetOrderLine(productName);

            if (orderLine != null)
            {
                orderLine.AddProduct();
            }
            else
            {
                Product product = productsRepository.GetProduct(productName);
                orderLine = new OrderLine(product);
                order.Add(orderLine);
            }
            return(orderLine);
        }