public IHttpActionResult Create([FromBody] InvoiceModel invoice) { if (invoice == null) { return(BadRequest()); } try { _invoices.Create(invoice); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }