Exemple #1
0
        public IActionResult Post([FromBody] DepartureDTO departureDTO)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                departureService.CreateEntity(departureDTO);
            }
            catch (ValidationException e)
            {
                return(BadRequest(new { Exception = e.Message }));
            }

            return(Ok(departureDTO));
        }