Example #1
0
        public IActionResult AddNewCategory(string categoryName)
        {
            var id = _categoryRepository.AddNewCategory(categoryName);

            if (id > 0)
            {
                return(Json(new
                {
                    success = true,
                    id
                }));
            }
            else
            {
                return(Json(new { success = false }));
            }
        }
 public void AddNewCategory(Category category)
 {
     _categoryRepo.AddNewCategory(category);
 }