Пример #1
0
        public IActionResult UpdateAirport([FromBody] Airport airport)
        {
            var response = new PutAirportResponse();

            try
            {
                response = _airportService.PutAirport(new PutAirportRequest {
                    UpdatedAirport = airport
                });
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.ToString()));
            }

            if (response.IsSuccessful)
            {
                return(Ok(response.Message));
            }
            else
            {
                return(BadRequest(response.Message));
            }
        }