コード例 #1
0
        public IActionResult CreateAircraft([FromBody] Aircraft aircraft)
        {
            var response = new PostAircraftResponse();

            try
            {
                response = _aircraftService.PostAircraft(new PostAircraftRequest {
                    NewAircraft = aircraft
                });
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.ToString()));
            }

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