public async Task <Flight> AddFlightAsycn(
     [FromBody] Flight flight,
     CancellationToken ct
     )
 {
     return(await _flightServices.CreateAsync(flight, ct));
 }
Ejemplo n.º 2
0
        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);
        }