Ejemplo n.º 1
0
        public ActionResult <JobOfferDTO> CreateJobOffer(JobOfferCreateDTO jobOfferCreateDto)
        {
            var jobOfferModel = _mapper.Map <JobOffer>(jobOfferCreateDto);

            _jobOfferRepository.CreateJobOffer(jobOfferModel);
            _jobOfferRepository.SaveChanges();

            var jobOfferDto = _mapper.Map <JobOfferDTO>(jobOfferModel);

            //return Ok(JobOfferDTO);
            return(CreatedAtRoute(nameof(GetJobOfferById), new { Id = jobOfferDto.JobId }, jobOfferDto));
        }