public IHttpActionResult Post(CustomerModel model) { try { if (ModelState.IsValid) { var result = dalObject.AddNewCustomer(model); return(Ok(result)); } } catch (Exception ex) { return(InternalServerError(ex)); } return(BadRequest(ModelState)); }