public async Task <IActionResult> AddFlight([FromBody] Flight flight) { #warning перенести в AIRPORT if (!ModelState.IsValid) { return(BadRequest() as IActionResult); } var entity = await service.AddFlightAsync(flight); return(entity == null?StatusCode(409) as IActionResult : Created($"{Request?.Scheme}://{Request?.Host}{Request?.Path}{entity.Id}", mapper.Map <FlightDTO>(entity))); }