public Task <PaginatedList <User> > GetCandidates(int jobId, QPage qPage) { return(PaginatedList <User> .CreateAsync( context.JobVacancies.Where(job => job.Id.Equals(jobId)).SelectMany(job => job.Candidates), qPage )); }
public async Task <ActionResult <PaginatedList <JobVacancy> > > List([FromQuery] QPage qPage, [FromQuery] string name = null) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } return(Ok(await jobService.List(qPage, name))); }
public Task <PaginatedList <JobVacancy> > List(QPage qPage, string name = null) { IQueryable <JobVacancy> jobVacancies = context.JobVacancies; if (string.IsNullOrEmpty(name) == false) { jobVacancies = jobVacancies.Where(jv => jv.Name.StartsWith(name)); } return(PaginatedList <JobVacancy> .CreateAsync(jobVacancies, qPage)); }
public async Task <ActionResult <PaginatedList <User> > > GetCandidates(int id, [FromQuery] QPage qPage) { var userId = int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value); if (await permissionService.UserHasPermission(userId, "view_candidates") == false) { return(Unauthorized()); } return(Ok(await jobService.GetCandidates(id, qPage))); }
public Task <PaginatedList <User> > GetCandidates(int jobId, QPage qPage) { return(jobRepository.GetCandidates(jobId, qPage)); }
public Task <PaginatedList <JobVacancy> > List(QPage qPage, string name = null) { return(jobRepository.List(qPage, name)); }