public IHttpActionResult UpdateItems(int id, [FromBody] InvoiceModel invoice) { if (invoice == null || invoice.DocEntry != id) { return(BadRequest()); } try { var invFound = _invoices.UpdateItems(id, invoice); if (!invFound) { return(NotFound()); } return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }