// GET: Invoices/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var invoice = await _invoicesRepository.GetInvoiceAsync(id.Value); if (invoice == null) { return(NotFound()); } return(View(invoice)); }