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

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

            value.Id = id;
            var entity = await _planeService.UpdateAsync(value);

            return(Json(entity));
        }