コード例 #1
0
        /// <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());
        }
コード例 #2
0
        /// <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());
        }