public ActionResult EditCategory(ComponentCategoryViewModel model) { var updatedEntity = AutoMapper.Mapper.Map <ComponentCategory>(model); _categoryRepo.Update(updatedEntity); return(RedirectToAction("ShowCategories")); }
public ActionResult AddComponentCategory(ComponentCategoryViewModel model) { var newEntity = AutoMapper.Mapper.Map <ComponentCategory>(model); _categoryRepo.Insert(newEntity); return(RedirectToAction("ShowCategories")); }