public int AddCategory(NewCategoryVm model) { var category = _mapper.Map <Category>(model); _categoryRepo.AddCategory(category); return(category.Id); }
public int AddCategory(NewCategoryVm newCategory) { var cat = _mapper.Map <Category>(newCategory); int id = _categoryAndQuestionRepo.AddCategory(cat); return(id); }
public IActionResult AddNewCategory(NewCategoryVm newCategoryModel) { var id = _categoryAndQuestionService.AddCategory(newCategoryModel); return(Redirect("/Home/ShowMenuForUser")); }
public void UpdateCategory(NewCategoryVm model) { var category = _mapper.Map <Category>(model); _categoryRepo.UpdateCategory(category); }
public IActionResult EditCategory(NewCategoryVm model) { _categoryService.UpdateCategory(model); return(RedirectToAction("Index")); }
public IActionResult AddCategory(NewCategoryVm model) { var id = _categoryService.AddCategory(model); return(RedirectToAction("Index")); }