public HttpResponseMessage PostPatient(Patient PatientModal) { try { if (ModelState.IsValid) { var result = _Patient.CreateNewPatient(PatientModal); if (result > 0) { var response = new HttpResponseMessage() { StatusCode = HttpStatusCode.OK }; return(response); } else { var response = new HttpResponseMessage() { StatusCode = HttpStatusCode.BadRequest }; return(response); } } else { var response = new HttpResponseMessage() { StatusCode = HttpStatusCode.BadRequest }; return(response); } } catch (Exception) { throw; } }