コード例 #1
0
ファイル: CategoryController.cs プロジェクト: HoenDHime/eShop
 public ActionResult Create(Category category)
 {
     if (ModelState.IsValid)
     {
         categoryRepository.Insert(category);
         categoryRepository.Save();
         return RedirectToAction("Index");
     }
     else
     {
         return View();
     }
 }
コード例 #2
0
ファイル: CategoryRepository.cs プロジェクト: HoenDHime/eShop
 public void Insert(Category category)
 {
     entities.Categories.Add(category);
 }