public User Get(long id) { var user = _repository.Get(id); if (user != null) { user.Skills = LoadSkills(id); var jobApplications = _jobApplicantRepository.GetAll().Where(x => x.IdApplicant == id); user.JobApplications = jobApplications .Where(x => x.Status.Equals(JobApplicantStatus.InProcess)) .Count(); user.JobApplicationsApproved = jobApplications .Where(x => x.Status.Equals(JobApplicantStatus.Approved)) .Count(); user.JobInterviews = _jobInterviewRepository.GetAll() .Where(x => x.IdJobApplicant == id) .Count(); } return(user); }
public List <JobInterview> GetAll() { var jobInterviews = _repository.GetAll(); foreach (var jobInterview in jobInterviews) { jobInterview.JobApplicant = _jobApplicantService.Get(jobInterview.IdJobApplicant); jobInterview.UserTechnical = _userService.Get(jobInterview.IdUserTechnical); jobInterview.UserRecruiter = _userService.Get(jobInterview.IdUserRecruiter); if (jobInterview.IdJobFeedBack.HasValue) { jobInterview.JobFeedBack = _jobFeedBackService.Get(jobInterview.IdJobFeedBack.Value); } } return(jobInterviews); }