public async Task <ActionResult> Create(Symptom symptom) { if (ModelState.IsValid) { await _symptomService.AddAsync(symptom); return(RedirectToAction(nameof(Index))); } return(View(symptom)); }
public async Task <IActionResult> PostSymptom([FromBody] SymptomDTO symptom) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } symptom = await _symptomService.AddAsync(symptom); return(CreatedAtAction("GetSymptom", new { id = symptom.SymptomId }, symptom)); }