public IResult Update(Products instance) { if (instance == null) { throw new ArgumentNullException(); } IResult result = new Result(false); try { this._repository.Update(instance); result.Success = true; } catch (Exception ex) { result.Exception = ex; } return result; }
public ActionResult Edit(Products products, string category) { if (ModelState.IsValid) { this._productService.Update(products); return RedirectToAction("Index", new { category = category }); } ViewBag.CategoryID = new SelectList(this.Categories, "CategoryID", "CategoryName", products.CategoryID); return View(products); }