public static VehicleRouteFilter CreateEntity(this VehicleRouteFilterDto dto) { return(new VehicleRouteFilter { DesiredDateInitial = dto.desiredDateInitial, DesiredDateFinal = dto.desiredDateFinal, ProductType = dto.productType }); }
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()); }