public ActionResult <DentistsReadDto> CreateDentist(DentistCreateDto dentistCreateDto) { var dentistModel = _mapper.Map <Dentist>(dentistCreateDto); _repository.CreateDentist(dentistModel); _repository.SaveChanges(); return(Ok(dentistModel)); }
public ActionResult UpdateDentist(int id, DentistCreateDto dentistCreateDto) { var dentistModelFromRepo = _repository.GetDentistById(id); if (dentistModelFromRepo == null) { return(NotFound()); } _mapper.Map(dentistCreateDto, dentistModelFromRepo); _repository.SaveChanges(); return(NoContent()); }