public async Task <IActionResult> UpdateStudent(int id, [FromBody] StudentEditModel studentForUpdate) { var student = await _quantumITAppService.UpdateStudentAsync(id, studentForUpdate); return(Ok(student)); throw new Exception($"updating student {id} failed on save!"); }
public async Task <IActionResult> UpdateStudent(int id, [FromBody] StudentEditModel studentForUpdate) { var student = await _quantumITAppService.UpdateStudentAsync(id, studentForUpdate); if (!student) { return(BadRequest(_error)); } return(Ok(student)); }