void CheckNull(Product product) { if (null == product) { throw new ArgumentNullException("id error, not product"); } }
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(); }
public void Add(Product product) { _service.Add(product); Save(); }
protected Product(Product product) : this(product.CategoryId, product.Name, product.Description, product.ImageUrl, product.Price, product.Id) { }