Example #1
0
        public virtual void AddItem(string productName, decimal price, int quantity)
        {
            if (price < 0)
                throw new ArgumentException("Price can't be negative");
            var shopOrderItem = new ShopOrderItem { ProductName = productName, Price = price, Quantity = quantity };

            this.AddItem(shopOrderItem);
        }
Example #2
0
 public virtual void AddItem(ShopOrderItem shopOrderItem)
 {
     this.ShopOrderItems.Add(shopOrderItem);
     shopOrderItem.ShopOrder = this;
 }