コード例 #1
0
        public IActionResult Post([FromBody] PlaneTypeDTO value)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    airport.CreatePlaneType(value);

                    return(Ok());
                }
                return(BadRequest(ModelState));
            }
            catch (System.Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
コード例 #2
0
        public async Task <IActionResult> Post([FromBody] PlaneTypeDTO value)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var result = await airport.CreatePlaneType(value);

                    return(Ok(result));
                }
                return(BadRequest(ModelState));
            }
            catch (System.Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }