常用方法
常用方法
常用方法
常用方法
public async Task <IActionResult> CreateTeacherAsync([FromBody] NewAccountViewModel account) { if (!ModelState.IsValid) { return(BadRequest(new ValidationError(ModelState))); } var newTeacher = await _teachersService.CreateTeacherAsync(_mapper.Map <TeacherDto>(account)); return(CreatedAtRoute("GetTeacher", new { teacherId = newTeacher.Id }, newTeacher)); }