public async Task <IActionResult> ModifyFlight(long id, [FromBody] FlightDTO flight) { if (!ModelState.IsValid) { return(BadRequest() as IActionResult); } var entity = await service.ModifyFlightAsync(id, mapper.Map <Flight>(flight)); return(entity == null?StatusCode(304) as IActionResult : Ok(mapper.Map <FlightDTO>(entity))); }