public ActionResult Create(CategoryViewModel model) { var category = new Category(); model.UpdateEntity(category, HttpContext.User.Identity.Name); Session.Save(category); return RedirectToAction("Index"); }
public ActionResult Edit(CategoryViewModel model) { var category = Session.Get<Category>(model.Id); if (category == null) throw new Exception("Category is null"); model.UpdateEntity(category, HttpContext.User.Identity.Name); Session.Save(category); return RedirectToAction("Index"); }