예제 #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();
            }
        }
예제 #2
0
 public void AddCategory(Category category)
 {
     entities.Category.Add(category);
 }