Exemplo n.º 1
0
        public IActionResult SelectCandidates(int id)
        {
            var vacancy = vacancyManager.Get(id);

            if (vacancy == null)
            {
                return(RedirectToAction("Index", "Candidate"));
            }
            else
            {
                List <Candidate> candidates = new List <Candidate>();
                foreach (var skill in vacancy.Skills.Select(s => s.Id))
                {
                    candidates.AddRange(candidateManager.GetAll().Where(v => v.Salary >= vacancy.Salary && v.Skills.Select(s => s.Id).Contains(skill)));
                }

                var entity = mapper.Map <ICollection <CandidateViewModel> >(candidates);
                return(View(entity));
            }
        }
Exemplo n.º 2
0
        public IActionResult Index()
        {
            var candidates = mapper.Map <ICollection <CandidateViewModel> >(candidateManager.GetAll());

            return(View(candidates));
        }
Exemplo n.º 3
0
 public IActionResult GetAll()
 {
     return(Ok(_candidateManager.GetAll()));
 }
 ///<inheritdoc/>
 public ICollection <CandidateDTO> GetAll()
 {
     return(mapper.Map <ICollection <CandidateDTO> >(candidateManager.GetAll()));
 }