public ActionResult Delete(int id, FormCollection collection) { try { var repository = new LivroRepository(); var delete = repository.DeleteLivro(id); return(RedirectToAction("Index")); } catch { return(View()); } }