private CreateManyIndexesOptions ToCreateManyIndexesOptions(CreateOneIndexOptions options)
 {
     return(new CreateManyIndexesOptions
     {
         CommitQuorum = options?.CommitQuorum,
         MaxTime = options?.MaxTime
     });
 }
        /// <inheritdoc />
        public virtual string CreateOne(
            CreateIndexModel <TDocument> model,
            CreateOneIndexOptions options       = null,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            var createManyIndexOptions = ToCreateManyIndexesOptions(options);
            var result = CreateMany(new[] { model }, createManyIndexOptions, cancellationToken);

            return(result.Single());
        }
        /// <inheritdoc />
        public virtual async Task <string> CreateOneAsync(
            CreateIndexModel <TDocument> model,
            CreateOneIndexOptions options       = null,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            var createManyIndexOptions = ToCreateManyIndexesOptions(options);
            var result = await CreateManyAsync(new[] { model }, createManyIndexOptions, cancellationToken).ConfigureAwait(false);

            return(result.Single());
        }
 private CreateManyIndexesOptions ToCreateManyIndexesOptions(CreateOneIndexOptions options)
 {
     return(new CreateManyIndexesOptions {
         MaxTime = options?.MaxTime
     });
 }