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)); } }
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)); } }