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

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

            var entity = await _planeService.CreateAsync(value);

            return(Json(entity));
        }