public ActionResult Edit(ProductVM prod) { try { // TODO: Add update logic here crudFactory.UpdateProduct(prod); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
//[ValidateAntiForgeryToken] public JsonResult Edit([FromBody] ProductVM prod) { try { if (prod != null) { crudFactory.UpdateProduct(prod); return(Json(prod)); } else { return(Json(new ProductVM())); } // TODO: Add update logic here } catch (Exception ex) { return(Json(ex.Message)); } }