Пример #1
0
 public static VehicleRouteFilter CreateEntity(this VehicleRouteFilterDto dto)
 {
     return(new VehicleRouteFilter
     {
         DesiredDateInitial = dto.desiredDateInitial,
         DesiredDateFinal = dto.desiredDateFinal,
         ProductType = dto.productType
     });
 }
Пример #2
0
        public List <VehicleRouteDto> GetVehicleRoutes(VehicleRouteFilterDto filter)
        {
            var vehicleRoutes = _vehicleRouteRepository.GetVehicleRoutes(filter.CreateEntity());

            foreach (var vehicleRoute in vehicleRoutes)
            {
                foreach (var subRoute in vehicleRoute.SubRoutes)
                {
                    subRoute.AddressOrigin  = _addressRepository.GetAddressByAddressId(subRoute.AddressOriginId);
                    subRoute.AddressDestiny = _addressRepository.GetAddressByAddressId(subRoute.AddressDestinyId);
                }
            }
            return(vehicleRoutes.CreateDto());
        }