public Task <PaginatedList <DriversQueryDto> > Handle(DriversQuery request, CancellationToken cancellationToken)
 {
     return(_unitOfWork.DriverRepository.GetAll()
            .Select(x => new DriversQueryDto
     {
         Id = x.Id,
         Email = x.PersonalInfo.Email,
         Name = x.PersonalInfo.Name,
         Surname = x.PersonalInfo.Surname,
         Nationality = x.PersonalInfo.Nationality,
         PhoneNumber = x.PersonalInfo.PhoneNumber,
         Priority = x.Priority,
         CarModel = x.Car.Model,
         CarRegistrationPlateNumber = x.Car.RegistrationPlateNumber,
         CompanyName = x.CompanyDetails.CompanyName,
         TaxIdentificationNumber = x.CompanyDetails.TaxIdentificationNumber
     })
            .AsPaginatedList(request.GetPagingElements()));
 }
Пример #2
0
 public async Task <PaginatedList <DriversQueryDto> > GetDrivers([FromQuery] DriversQuery query)
 => await Mediator.Send(query);