public ActionResult Excluir(FilmeViewModel viewModel) { try { var filme = Mapper.Map <Filme>(viewModel); _filmeService.Remove(filme); return(RedirectToAction("Index")); } catch (Exception e) { throw; } }
public ActionResult Delete(int id, FormCollection collection) { try { if (ModelState.IsValid) { var entity = _service.Get(id); _service.Remove(entity); } return(RedirectToAction("Index")); } catch { return(View()); } }