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