public async Task<IHttpActionResult> PutAsync(Patient user) { IHttpActionResult result = null; try { int modifiedCount = await IPatientManager.RegisterNewOrUpdateDetailsAsync(user); if (modifiedCount > 0) { result = Ok("User details update succeded"); } else { result = Ok("User details update failed.Please retry."); } } catch (Exception ex) { result = InternalServerError(ex); } return result; }
public async Task<IHttpActionResult> PostAsync(Patient user) { IHttpActionResult result = null; try { if (ModelState.IsValid) { int modifiedCount = await IPatientManager.RegisterNewOrUpdateDetailsAsync(user); if (modifiedCount > 0) { result = Ok("New user registration succeded"); } else { result = Ok("New user registration failed.Please retry."); } } else { result = BadRequest(ModelState); } } catch (Exception ex) { result = InternalServerError(ex); } return result; }