public async Task <Flight> AddFlightAsycn( [FromBody] Flight flight, CancellationToken ct ) { return(await _flightServices.CreateAsync(flight, ct)); }
public async Task <ActionResult <Flight> > Create([FromBody] FlightCreateRequest request) { var flight = await _flightService.CreateAsync(new Flight { Number = request.Number, DayOfWeek = request.DayOfWeek, Destination = request.Destination, ScheduledDepartureTime = DateTime.ParseExact(request.ScheduledDepartureTime, "HH:mm:ss", CultureInfo.InvariantCulture) }); return(flight); }