public ActionResult Create(MessageFormModel model) { var item = Mapper.Map<MessageFormModel, Message>(model); GetSession.Save(item); return RedirectToAction("Index"); }
public ActionResult Edit(MessageFormModel model) { if (ModelState.IsValid) { var item = GetSession.Get<Message>(model.Id); Mapper.Map<MessageFormModel, Message>(model, item); GetSession.Update(item); return RedirectToAction("Index"); } return View(model); }
public ActionResult Create() { var model = new MessageFormModel(); return View(model); }