public async Task <ActionResult <Invoice> > GetInvoice(int id) { try { return(await _invoiceRepository.GetAsync(id)); } catch (DBNotFoundException) { return(NotFound()); } catch (Exception) { return(StatusCode(StatusCodes.Status500InternalServerError)); } }