Exemple #1
0
        public async Task <IActionResult> Post([FromBody] DepartureDTO value)
        {
            var validationResult = await _depatureModelValidator.ValidateAsync(value);

            if (!validationResult.IsValid)
            {
                throw new BadRequestException(validationResult.Errors);
            }

            var entity = await _departureService.CreateAsync(value);

            return(Json(entity));
        }