Exemplo n.º 1
0
 public async Task CreateSkill(SkillTagDto skill)
 {
     using (var unitOfWork = UnitOfWorkProvider.Create())
     {
         skillService.Create(skill);
         await unitOfWork.Commit();
     }
 }
        public async Task <ActionResult> Create(SkillTagDto dto)
        {
            if (ModelState.IsValid)
            {
                await SkillFacade.CreateSkill(dto);

                return(RedirectToAction("Index"));
            }

            return(View(dto));
        }
Exemplo n.º 3
0
        public async Task <IEnumerable <JobOfferDto> > GetOffersBySkill(int skillId)
        {
            using (UnitOfWorkProvider.Create())
            {
                SkillTagDto skill = await skillService.GetAsync(skillId, false);

                if (skill == null)
                {
                    return(null);
                }

                return(await jobOfferService.GetBySkills(skill));
            }
        }
Exemplo n.º 4
0
        public async Task <bool> EditSkill(SkillTagDto skill)
        {
            using (var uow = UnitOfWorkProvider.Create())
            {
                if ((await skillService.GetAsync(skill.Id, false)) == null)
                {
                    return(false);
                }
                await skillService.Update(skill);

                await uow.Commit();

                return(true);
            }
        }
Exemplo n.º 5
0
        public async Task <IList <JobOfferDto> > GetBySkills(SkillTagDto skillTagDto)
        {
            SkillTag skillTag = Mapper.Map <SkillTag>(skillTagDto);

            return(Mapper.Map <IList <JobOfferDto> >(await(jobOfferRepository.GetBySkill(skillTag))));
        }