public ActionResult Edit(int? id) { var _tag = Tag.Get(id ?? 0); var tag = Mapper.Map<TagModel>(_tag); var view = new TagEditContainer { Tag = tag }; return View("edit", view); }
public ActionResult Edit(TagModel model) { if (!ModelState.IsValid) { var view = new TagEditContainer { Tag = model }; return View("edit", view); } var tag = Mapper.Map<Tag>(model); Tag.Set(tag); return RedirectToAction("index", "tag"); }