Exemple #1
0
        public SimulationResult SimulateFlight(string fromIata, string toIata, string aircraftModel)
        {
            var fromAirport = airportService.GetByIataCode(fromIata);
            var toAirport   = airportService.GetByIataCode(toIata);
            var aircraft    = aircraftService.GetByModel(aircraftModel);

            return(SimulateFlight(fromAirport, toAirport, aircraft));
        }
Exemple #2
0
 public ActionResult <Aircraft> Get(string model)
 {
     try
     {
         return(Ok(AircraftService.GetByModel(model)));
     }
     catch (Exception ex)
     {
         logger.LogError(1, ex, "No aircraft found with model {1}", model);
         return(NotFound($"No aircraft found with model {model}"));
     }
 }