public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Invoice = await _invoiceService.GetInvoiceById(id); if (Invoice == null) { return(NotFound()); } InvoiceDetails = await _invoiceDetailService.GetAllInvoiceDetails(Invoice.Id); return(Page()); }