public async Task <IActionResult> CreateDoctor(InputDoctorDTO doctor) { if (ModelState.IsValid) { await _doctorService.Add(doctor); } return(Ok($"Doutor {doctor.Name} cadastrado.")); }
public async Task Add(InputDoctorDTO doctorDto) { var doctorCreate = _mapper.Map <CreateDoctorCommand>(doctorDto); await _mediator.Send(doctorCreate); }