public async Task <IActionResult> PutAirline(int id, [FromBody] AirlineDto value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var bucket = _bucketProvider.GetBucket("travel-sample");

            var document = await bucket.GetDocumentAsync <Airline>(Airline.GetKey(id));

            if (document.Status == ResponseStatus.KeyNotFound)
            {
                return(NotFound());
            }

            document.EnsureSuccess();

            _mapper.Map(value, document.Content);

            var result = await bucket.ReplaceAsync(document.Document);

            result.EnsureSuccess();

            return(Ok(_mapper.Map <AirlineDto>(document.Content)));
        }
        public async Task <IActionResult> PostAirline([FromBody] AirlineDto value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var bucket = _bucketProvider.GetBucket("travel-sample");

            var content = _mapper.Map <Airline>(value);

            content.Id = await GetNextId(bucket);

            var document = new Document <Airline>
            {
                Content = content,
                Id      = Airline.GetKey(content.Id)
            };

            var result = await bucket.InsertAsync(document);

            result.EnsureSuccess();

            return(Ok(_mapper.Map <AirlineDto>(content)));
        }