public IActionResult Create(Invoice inVM) { if (ModelState.IsValid) { InvoiceRepo inVMRepo = new InvoiceRepo(_context); var success = inVMRepo.Create(inVM); if (success) { return(RedirectToAction(nameof(Index))); } } ViewBag.Error = "An error occurred while creating this invoice. Please try again."; return(View()); }
public void Add(Invoice t) { repo.Create(t); }