Ejemplo n.º 1
0
        public async Task <ResponseList <TransportResponse> > GetTransportsForOrder(TransportForOrderRequest request)
        {
            var transports = await _uow.Transports.Search(true);

            // pokud neexistuje sluzba, odflitrovat Osobni doruceni agentem
            if (!request.HasService)
            {
                transports = transports.Where(transport => transport.Type != TransportType.PersonalDelivery).ToList();
            }

            var response = transports.Select(x => _mapService.MapTransport(x)).ToList();

            return(new ResponseList <TransportResponse>(ResponseStatus.Ok, response));
        }
Ejemplo n.º 2
0
        public async Task <IHttpActionResult> GetTransportsForOrder([FromUri] TransportForOrderRequest request)
        {
            var response = await _transportService.GetTransportsForOrder(request);

            return(new CreateResult(response));
        }