Esempio n. 1
0
 public ActionResult Create(Category category)
 {
     if (ModelState.IsValid)
     {
         categoryRepository.Insert(category);
         categoryRepository.Save();
         return RedirectToAction("Index");
     }
     else
     {
         return View();
     }
 }
Esempio n. 2
0
 public void Insert(Category category)
 {
     entities.Categories.Add(category);
 }