public HttpResponseMessage UpdatePassword([FromBody] JObject data) { string userName = (string)data["userName"]; string oldpassword = (string)data["oldpassword"]; string newPassord = (string)data["newPassord"]; return(HomeLogic.UpdatePassword(userName, oldpassword, newPassord) ? new HttpResponseMessage(HttpStatusCode.OK) : new HttpResponseMessage(HttpStatusCode.BadRequest) { Content = new ObjectContent <String>("The password dont currect", new JsonMediaTypeFormatter()) }); }