public IActionResult Post([FromBody] DeparturesDTO departure) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = _service.AddObject(departure); return(result == true?StatusCode(200) : StatusCode(404)); }