public IActionResult Delete(int id) { InvoiceRepo deleteInvoiceRepo = new InvoiceRepo(_context); var success = deleteInvoiceRepo.Delete(id); if (success) { return(RedirectToAction(nameof(Index))); } ViewBag.Error = "An error occurred while deleting this invoice. Please try again."; return(View()); }
public void Remove(Invoice t) { repo.Delete(t); }