public ActionResult Create(CategoryViewModel categoryViewModel) { try { var categoryDomain = Mapper.Map<CategoryViewModel, Category>(categoryViewModel); _categoryAppService.Add(categoryDomain); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Edit(CategoryViewModel categoryViewModel) { try { var categoryModel = Mapper.Map<CategoryViewModel, Category>(categoryViewModel); _categoryAppService.Update(categoryModel); return RedirectToAction("Index"); } catch { return View(); } }