public ActionResult Create(ShoppingListViewModel model) { var shoppingList = new ShoppingList(); model.UpdateEntity(shoppingList, HttpContext.User.Identity.Name); Session.Save(shoppingList); return RedirectToAction("Index"); }
public ActionResult Edit(ShoppingListViewModel model) { var shoppingList = Session.Get<ShoppingList>(model.Id); if (shoppingList == null) throw new Exception("Shopping list not found"); model.UpdateEntity(shoppingList, HttpContext.User.Identity.Name); Session.Save(shoppingList); return RedirectToAction("Index"); }