public async Task <ActionResult <JobPosting> > CheckJobPostingAsync(TestCheckDTO tcDTO) { if (tcDTO.url != null) { bool jobPostingCount = await _JobPostingRepository.Exists(tcDTO); return(Ok(jobPostingCount)); } else { return(BadRequest(false)); } }
public async Task <bool> Exists(TestCheckDTO tcDTO) { JobPosting jobPosting = await _ctx.JobPostings .Where(x => x.Description.Equals(tcDTO.description) == true && x.Title.Equals(tcDTO.title) == true) .FirstOrDefaultAsync(); if (jobPosting != null) { return(true); } return(false); }