public ActionResult Edit(ProductDetails model) { if (!ModelState.IsValid) return View(model); ProductService.Upsert(model); return RedirectToAction("Index"); }
public OperationResult Upsert(ProductDetails model) { try { ProductRepository.Upsert(model); return new OperationResult {Success = true, Message = string.Empty}; } catch (Exception) { return new OperationResult { Success = false, Message = string.Empty }; throw; } }