public IActionResult DeletarAutor(int id)
        {
            aluguelContexto.Remove(aluguelContexto.Autores.Find(id));

            aluguelContexto.SaveChanges();

            return(RedirectToAction(nameof(Autor)));
        }
        public IActionResult DeletarEditora(int id)
        {
            aluguelContexto.Remove(aluguelContexto.Editoras.Find(id));

            aluguelContexto.SaveChanges();

            return(RedirectToAction(nameof(Editora)));
        }
        public IActionResult DeletarLivro(int id)
        {
            aluguelContexto.Remove(aluguelContexto.Livros.Find(id));

            aluguelContexto.SaveChanges();

            return(RedirectToAction(nameof(Livro)));
        }
        public IActionResult DeletarCliente(int id)
        {
            aluguelContexto.Remove(aluguelContexto.Clientes.Find(id));

            aluguelContexto.SaveChanges();

            return(RedirectToAction(nameof(Cliente)));
        }
Exemplo n.º 5
0
        public IActionResult DeletarEmprestimo(int id)
        {
            aluguelContexto.Remove(aluguelContexto.Emprestimos.Find(id));

            aluguelContexto.SaveChanges();

            return(RedirectToAction(nameof(Emprestimo)));
        }