public IHttpActionResult PutProducts(ProductData product) { if (ModelState.IsValid) { Product pro = service.FindById(4); pro.Name = product.Name; service.Edit(pro); } return(Ok(false)); }
public IActionResult Edit(ProductFormVM model) { if (!ModelState.IsValid) { return(View(model)); } string thumb = UploadFile(model.Product.file); model.Product.Thumb = string.IsNullOrEmpty(thumb) ? model.Product.Thumb : thumb; productOperations.Edit(model.Product); return(View(model)); }
public IActionResult Edit([FromQuery] ProductChangeModel model) { if (ModelState.IsValid) { _productOperations.Edit(model); } else { return(BadRequest()); } return(Ok()); }
public IActionResult Edit([FromBody] ProductViewModel model) { var res = product.Edit(model); return(Ok(res)); }