Beispiel #1
0
        public IResult Create(Category instance)
        {
            if (instance == null)
            {
                throw new ArgumentNullException();
            }

            IResult result = new Result(false);
            try
            {
                this._repository.Create(instance);
                result.Success = true;
            }
            catch (Exception ex)
            {
                result.Exception = ex;
            }
            return result;
        }
 public ActionResult Edit(Category category)
 {
     if (category != null &&
         ModelState.IsValid)
     {
         this.categoryService.Update(category);
         return View(category);
     }
     else
     {
         return RedirectToAction("index");
     }
 }