Exemplo n.º 1
0
        public PagedResultDto <AppliedJobListDTO> GetAppliedJobs(GetAllAppliedJobsInput input)
        {
            var jobAppliedQuery = _appliedJobsRepository
                                  .GetAll()
                                  .Where(t => t.CreatorUserId == input.CreatorUserId)
                                  .Select(t => new AppliedJobListDTO
            {
                AppliedJobId              = t.Id,
                CompanyName               = t.JobInfo.CompanyName,
                Position                  = t.JobInfo.Position,
                Eligibility               = t.JobInfo.Eligibility,
                SkillsRequired            = t.JobInfo.SkillsRequired,
                MinimumExperienceRequired = t.JobInfo.MinimumExperienceRequired
            });



            var pagedResult = jobAppliedQuery.OrderByDescending(p => p.AppliedJobId)
                              .Skip(input.SkipCount)
                              .Take(input.MaxResultCount)
                              .ToList();


            var totalcount = jobAppliedQuery.Count();
            var jobmapped  = ObjectMapper.Map <List <AppliedJobListDTO> >(pagedResult);

            return(new PagedResultDto <AppliedJobListDTO>(totalcount, jobmapped));
        }
Exemplo n.º 2
0
        public async Task <ListResultDto <AppliedJobListDTO> > GetAll(GetAllAppliedJobsInput input)
        {
            var m = await _appliedJobsRepository.GetAll()
                    .Where(t => t.CreatorUserId == input.CreatorUserId)
                    .Select(t => new AppliedJobListDTO {
                AppliedJobId = t.Id, CompanyName = t.JobInfo.CompanyName, Position = t.JobInfo.Position, Eligibility = t.JobInfo.Eligibility, SkillsRequired = t.JobInfo.SkillsRequired, MinimumExperienceRequired = t.JobInfo.MinimumExperienceRequired
            })
                    .ToListAsync();


            //var m = await _appliedJobsRepository.GetAll()
            //   .Where(t => t.CreatorUserId == input.CreatorUserId)
            //   .Select(t => new AppliedJobListDTO { t.Id, t.JobInfo.CompanyName, t.JobInfo.Position, t.JobInfo.Eligibility, t.JobInfo.SkillsRequired, t.JobInfo.MinimumExperienceRequired })
            //   .ToListAsync();

            var applied = ObjectMapper.Map <List <AppliedJobListDTO> >(m);

            return(new ListResultDto <AppliedJobListDTO>(m));
        }