public ActionResult <DoctorReadDTO> CreateDoctor(DoctorCreateDTO doctorCreateDTO) { var createDoctor = _mapper.Map <Doctor>(doctorCreateDTO); //for creating the doctor if (createDoctor != null) { _repository.CreateDoctor(createDoctor); } else { return(BadRequest(createDoctor)); } _repository.SaveChanges(); //for returining the doctor that was just created var doctorReadDTO = _mapper.Map <DoctorReadDTO>(createDoctor); return(Ok(doctorReadDTO)); }
public ActionResult CreateDoctor(Doctor doctor) { _repo.CreateDoctor(doctor); return(NoContent()); }