public ActionResult Create(Categories category) { if (category != null && ModelState.IsValid) { this._categoryService.Create(category); return RedirectToAction("index"); } else { return View(category); } }
public ActionResult Edit(Categories category) { if (category != null && ModelState.IsValid) { this.categoryRepository.Update(category); return View(category); } else { return RedirectToAction("index"); } }
public IResult Update(Categories 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; }