public async Task <IActionResult> Update([FromBody] PatientSymptomDTO symptom) { var outputHandler = await _service.Update(symptom); if (outputHandler.IsErrorOccured) { return(BadRequest(outputHandler.Message)); } return(Ok(outputHandler.Message)); }
public async Task <IActionResult> PutSymptom([FromRoute] int id, [FromBody] SymptomDTO symptom) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != symptom.SymptomId) { return(BadRequest()); } var dbSymptom = await _symptomService.GetByIdAsync(symptom.SymptomId); if (dbSymptom == null) { return(NotFound()); } try { dbSymptom.SymptomName = symptom.SymptomName; await _symptomService.Update(dbSymptom); } catch (DbUpdateConcurrencyException) { if (!await SymptomExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }