コード例 #1
0
        public async Task <IActionResult> ModifyPilot(long id, [FromBody] PilotDTO pilot)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest() as IActionResult);
            }

            var entity = await service.UpdatePilotInfoAsync(id, mapper.Map <Pilot>(pilot));

            return(entity == null?StatusCode(304) as IActionResult
                   : Ok(mapper.Map <PilotDTO>(entity)));
        }