Пример #1
0
        public ActionResult AddCategories(CategoryModel categoryModel)
        {
            //try
            //{
            if (ModelState.IsValid)
            {
                Category category = AutoMapper.Mapper.Map <CategoryModel, Category>(categoryModel);

                categoryBL.AddCategory(category);
                return(RedirectToAction("CategoryDetails"));
            }
            //}
            //catch
            //{
            //    View("Error");
            //}
            return(View());
        }