Exemplo n.º 1
0
 public async Task <PaginatedList <CustomerRidesQueryDto> > Handle(CustomerRidesQuery request, CancellationToken cancellationToken)
 {
     return(await _unitOfWork.RideRepository.GetFinishedRidesByCustomerId(request.Id)
            .Select(x => new CustomerRidesQueryDto
     {
         Id = x.Id,
         FinishedDate = x.FinishedDate,
         CarModel = x.DriverDetails.CarModel,
         Status = x.Status,
         Price = _mapper.Map <MoneyDto>(x.Price)
     })
            .AsPaginatedList(request.GetPagingElements()));
 }
Exemplo n.º 2
0
 public async Task <PaginatedList <CustomerRidesQueryDto> > GetCustomerRides(int customerId,
                                                                             [FromQuery] CustomerRidesQuery query)
 {
     query.SetId(customerId);
     return(await Mediator.Send(query));
 }