public ActionResult Create(RoleViewModel rol) { if (ModelState.IsValid) { service.Create(rol.ToDTORole()); return RedirectToAction("Index"); } else { return View("Create", rol); } }
public ActionResult Edit(RoleViewModel collection) { if (ModelState.IsValid) { try { service.Update(collection.ToDTORole()); return RedirectToAction("Index"); } catch { return View(); } } else { return View("Edit", collection); } }