コード例 #1
0
        public ActionResult EditCategory(ComponentCategoryViewModel model)
        {
            var updatedEntity = AutoMapper.Mapper.Map <ComponentCategory>(model);

            _categoryRepo.Update(updatedEntity);
            return(RedirectToAction("ShowCategories"));
        }
コード例 #2
0
        public ActionResult AddComponentCategory(ComponentCategoryViewModel model)
        {
            var newEntity = AutoMapper.Mapper.Map <ComponentCategory>(model);

            _categoryRepo.Insert(newEntity);
            return(RedirectToAction("ShowCategories"));
        }