Example #1
0
        public ActionResult Create(Category category)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    UnitOfWork_.CategoryRepo.AddCategory(category);
                    UnitOfWork_.CategoryRepo.Save();
                    return RedirectToAction("Index");
                }

                return View();
            }
            catch
            {
                return View();
            }
        }
Example #2
0
 public void AddCategory(Category category)
 {
     entities.Category.Add(category);
 }