Exemplo n.º 1
0
        public async Task <IActionResult> Post([FromBody] FlightDto flightDto)
        {
            try
            {
                var flightToReturn = await _flightService.AddEntityAsync(flightDto);

                return(CreatedAtRoute("GetFlight", new { id = flightToReturn.Id }, flightToReturn));
            }
            catch (BadRequestException)
            {
                return(BadRequest());
            }
        }