public List <JobPostings> GetJobPostingByFilter(JobPostingFilter filter) { CheckJobPostings(); return(_context.JobPostings .AsNoTracking() .Include(x => x.SalaryType) .Include(x => x.Company) .Include(x => x.EmploymentType) .Where(x => x.Active == true) .Where(matchesFilter(filter)) .ToList()); }
public List <JobPostings> GetJobPostingByFilter([FromBody] JobPostingFilter filter) { return(_JobPostingService.GetJobPostingByFilter(filter)); }
private System.Linq.Expressions.Expression <System.Func <JobPostings, bool> > matchesFilter(JobPostingFilter filter) { if (filter == null) { return(posting => false); } return(posting => (filter.Start == null || posting.DatePosted >= filter.Start) && (filter.End == null || posting.DatePosted <= filter.End) && (filter.Company == null || posting.Company.CompanyName.ToLower().Contains(filter.Company.ToLower())) && (filter.EmploymentTypeId == null || posting.EmploymentTypeId == filter.EmploymentTypeId)); }
public List <JobPostings> GetJobPostingByFilter(JobPostingFilter filter) { return(_JobPostingRepository.GetJobPostingByFilter(filter)); }