public ActionResult Create(Product product) { if (ModelState.IsValid) { product.Id = "product/"; DBSession.Store(product); DBSession.SaveChanges(); return RedirectToAction("Index"); } return View(product); }
public ActionResult Edit(Product product) { if (ModelState.IsValid) { DBSession.Store(product); DBSession.SaveChanges(); return RedirectToAction("Index"); } else { return View(product); } }