Example #1
0
        public ShowCategoriesViewModel()
        {
            // I just want this here to be able to use LabelFor
            Category = new ComponentCategoryViewModel();

            Categories = new List <ComponentCategoryViewModel>();
        }
        public ShowCategoriesViewModel()
        {
            // I just want this here to be able to use LabelFor
            Category = new ComponentCategoryViewModel();

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