public async Task <IActionResult> Post([FromBody] FlightDTO flight) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = await _service.CreateObjectAsync(flight); return(result == true?StatusCode(200) : StatusCode(500)); }