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));
            }
        }
示例#2
0
        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);
        }