Exemplo n.º 1
0
        public int AddMainCategory(NewMainCategoryVm model, string userId)
        {
            var mainCat = _mapper.Map <MainCategory>(model);

            mainCat.ApplicationUserId = userId;
            var id = _mainCRepo.AddMainCategory(mainCat);

            return(id);
        }
Exemplo n.º 2
0
 public void CreateMainCategory(CategoryDTO viewmodel)
 {
     try
     {
         MainCategory newcategory = Mapper.Map <CategoryDTO, MainCategory>(viewmodel);
         _categoryRepository.AddMainCategory(newcategory);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemplo n.º 3
0
 public IActionResult Create(MainCategory mainCategory)
 {
     _mainCategory.AddMainCategory(mainCategory);
     return(RedirectToAction("Index"));
 }