Example #1
0
 void CheckNull(Product product)
 {
     if (null == product)
     {
         throw new ArgumentNullException("id error, not product");
     }
 }
Example #2
0
        public void Edit(string id, Product productNew)
        {
            //si no existe producto, lanza excepcion
            var checknullproduct = Get(id);
            CheckNull(checknullproduct);

            int _id = Int32.Parse(id);
            _service.Edit(_id, productNew);
              Save();
        }
Example #3
0
 public void Add(Product product)
 {
     _service.Add(product);
     Save();
 }
Example #4
0
 protected Product(Product product)
     : this(product.CategoryId, product.Name, product.Description, product.ImageUrl, product.Price, product.Id)
 {
 }