public ActionResult Create(Product product) { try { documentSession.Store(product); documentSession.SaveChanges(); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Edit(int id, Product product) { try { // TODO: Add update logic here var ravenProduct = documentSession.Load<Product>(id); ravenProduct.Update(product); documentSession.SaveChanges(); return RedirectToAction("Index"); } catch { return View(); } }
public void Update(Product product) { Name = product.Name; Description = product.Description; LongDescription = product.LongDescription; Price = product.Price; StockAmount = product.StockAmount; Image = product.Image; }