public async Task <ActionResult <CustomerApiModel> > Get(int id, CancellationToken ct = default) { try { var customer = await _BlazorSupervisor.GetCustomerByIdAsync(id, ct); if (customer == null) { return(NotFound()); } return(Ok(customer)); } catch (Exception ex) { return(StatusCode(500, ex)); } }
public async Task <ActionResult <InvoiceApiModel> > GetByCustomerId(int id, CancellationToken ct = default) { try { if (await _BlazorSupervisor.GetCustomerByIdAsync(id, ct) == null) { return(NotFound()); } return(Ok(await _BlazorSupervisor.GetInvoiceByCustomerIdAsync(id, ct))); } catch (Exception ex) { return(StatusCode(500, ex)); } }