public async Task <ActionResult <JobTypeDto> > FindById(int id)
        {
            var jobType = await _repository.GetById(id);

            return(jobType != null
                ? (ActionResult <JobTypeDto>)Ok(jobType)
                : NotFound(JobTypeNotFound));
        }
Exemplo n.º 2
0
        public async Task <bool> Edit(JobOffer item)
        {
            var offer = await _jobOfferRepo.GetById(item.JobOfferId);

            offer.JobCategory = await _jobCategoryRepo.GetById(item.JobCategoryId);

            offer.JobType = await _jobTypeRepo.GetById(item.JobTypeId);

            offer.PostalCode  = item.PostalCode;
            offer.Title       = item.Title;
            offer.Description = item.Description;
            offer.Wage        = item.Wage;
            offer.LastEdit    = DateTime.Now;

            try
            {
                _jobOfferRepo.Update(offer);
                await _unitOfWork.Save();
            }
            catch (DbUpdateConcurrencyException)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 3
0
 public async Task <JobType> GetTypeById(string id)
 {
     return(await _repo.GetById(id));
 }