// GET: api/Filghts public IEnumerable <object> Get() { var res = _flightServices.GetFlight() .ToList() .Select(f => new FlightModel { Departure = f.Departure, Destination = f.Destination, Distance = f.Distance, FuelConsumption = f.FuelConsumption }); return(res); }
public async Task <IActionResult> GetFlightById(int flightId) { var aircrafts = await _aircraftServices.GetAllAircrafts(new PaginationArgs()); var airports = await _airportServices.GetAllAirports(new PaginationArgs()); ViewData["aircrafts"] = aircrafts; ViewData["airports"] = airports; var flight = await _flightServices.GetFlight(new GetFlightArgs() { FlightId = flightId }); return(View(flight)); }
// GET: Flight public ActionResult Index() { var Model = _flightService.GetFlight(); return(View(Model)); }
public IActionResult GetFlight(int id) { return(Ok(_flightServices.GetFlight(id))); }