Beispiel #1
0
        public async Task <IEnumerable <WeightedCandidate> > GetMatch(int jobId)
        {
            var jobs = await _jobAdderService.GetJobs(jobId);

            var job = jobs.FirstOrDefault();

            if (job == null)
            {
                return(new List <WeightedCandidate>());
            }

            var candidates = await _jobAdderService.GetCandidates(null);

            var jw = await _jobSkillWeightService.GetJobSkillWeights();

            var wc = candidates.Select(c => new WeightedCandidate(c)).ToList();

            wc.ForEach(c =>
            {
                _matchService.Calculate(job, c, jw);
            });

            wc.RemoveAll(c => c.JobWeight <= 0);
            wc.Sort();

            return(wc);
        }