public async Task <IActionResult> GetAllVacancies(string title, string location)
        {
            var result = await _service.GetAllVacanciesAsync();

            var resultQuerable = result.AsQueryable();

            if (!string.IsNullOrWhiteSpace(title))
            {
                resultQuerable = resultQuerable.Where(x => x.JobTitle.ToLower().Contains(title.ToLower()));
            }

            if (!string.IsNullOrWhiteSpace(location))
            {
                resultQuerable = resultQuerable.Where(x => x.Location.ToLower().Contains(location.ToLower()));
            }

            return(Ok(resultQuerable.ToList()));
        }
        public async Task <IActionResult> GetAllVacancies()
        {
            var result = await _service.GetAllVacanciesAsync();

            return(Ok(result));
        }
Beispiel #3
0
 public async Task <ActionResult <ResponseMessageResult <PagedList <VacancyGeneralInfoViewModel> > > > GetAll
     (int pageIndex = -1, int pageSize = 15)
 {
     return(await _vancancyService.GetAllVacanciesAsync(pageIndex, pageSize));
 }