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

            Categories = new List <ComponentCategoryViewModel>();
        }
コード例 #2
0
        public ShowCategoriesViewModel()
        {
            // I just want this here to be able to use LabelFor
            Category = new ComponentCategoryViewModel();

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