Beispiel #1
0
        public async Task <List <ApplicantDto> > Handle(GetApplicantListQuery request, CancellationToken cancellationToken)
        {
            var applicants = await _dbContext.Applicants.Where(i => i.IsDeleted == false).ToListAsync();

            var output = applicants.Select(x => new ApplicantDto
            {
                ID              = x.Id,
                Name            = x.Name,
                FamilyName      = x.FamilyName,
                Address         = x.Address,
                EMailAdress     = x.EMailAdress,
                CountryOfOrigin = x.CountryOfOrigin,
                Age             = x.Age,
                Hired           = x.Hired
            }).ToList();

            return(output);
        }
Beispiel #2
0
 public async Task <ActionResult <PagedResult <ApplicantViewModel> > > GetList([FromQuery] GetApplicantListQuery query)
 {
     return(await Mediator.Send(query));;
 }