private FlightDetailsResponse CombineResponse(FlightRouteResponse routeData, Flight nearestFlightDetails) { return(new FlightDetailsResponse() { Distance = routeData.Distance, EstimatedLengthInHrs = routeData.EstimatedLengthInHrs, NearestFlightDate = nearestFlightDetails.FlightDate, FreeSeatsCount = nearestFlightDetails.SeatsFree, Success = routeData.Success, }); }
private FlightRouteResponse GetRouteData(string origin, string destination) { FlightRouteResponse routeData = null; try { var routeServiceClient = new FlightRouteService.FlightRouteRetrievalServiceClient(); routeData = routeServiceClient.GetFlightRoute( new FlightRouteRequest() { Origin = origin, Destination = destination }); return(routeData); } catch (Exception e) { _log.Error(e.Message); return(new FlightRouteResponse() { Success = false }); } }