public ActionResult UpdateCategory(CategoryViewModel model) { if (ModelState.IsValid) { var categoryEntity = Mapper.Map<CategoryViewModel, Category>(model); _clothesService.UpdateCategory(categoryEntity); return RedirectToAction("CreateCategory"); } return PartialView("EditCategory", model); }
public ActionResult CreateCategory(CategoryViewModel category) { if (ModelState.IsValid) { var categoryEntity = Mapper.Map<CategoryViewModel, Category>(category); _clothesService.AddCategory(categoryEntity); return RedirectToAction("CreateCategory"); } return View(); }