예제 #1
0
        public ActionResult Create(Product product)
        {
            if (ModelState.IsValid)
            {
                product.Id = "product/";
                DBSession.Store(product);
                DBSession.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(product);
        }
예제 #2
0
 public ActionResult Edit(Product product)
 {
     if (ModelState.IsValid)
     {
         DBSession.Store(product);
         DBSession.SaveChanges();
         return RedirectToAction("Index");
     }
     else
     {
         return View(product);
     }
 }