Cancellation tokens for CombinedTextIndex and DropIndex
This commit is contained in:
@@ -642,39 +642,183 @@ namespace MongoDbGenericRepository
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<string> CreateCombinedTextIndexAsync<TDocument>(
|
||||
IEnumerable<Expression<Func<TDocument, object>>> fields,
|
||||
IndexCreationOptions indexCreationOptions = null,
|
||||
string partitionKey = null)
|
||||
public async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields)
|
||||
where TDocument : IDocument<Guid>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync<TDocument, Guid>(fields, indexCreationOptions, partitionKey);
|
||||
return await CreateCombinedTextIndexAsync<TDocument, Guid>(fields, null, null, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(
|
||||
IEnumerable<Expression<Func<TDocument, object>>> fields,
|
||||
IndexCreationOptions indexCreationOptions = null,
|
||||
string partitionKey = null)
|
||||
public async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<Guid>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync<TDocument, Guid>(fields, null, null, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions)
|
||||
where TDocument : IDocument<Guid>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync<TDocument, Guid>(fields, indexCreationOptions, null, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<Guid>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync<TDocument, Guid>(fields, indexCreationOptions, null, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, string partitionKey)
|
||||
where TDocument : IDocument<Guid>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync<TDocument, Guid>(fields, null, partitionKey, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, string partitionKey, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<Guid>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync<TDocument, Guid>(fields, null, partitionKey, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions, string partitionKey)
|
||||
where TDocument : IDocument<Guid>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync<TDocument, Guid>(fields, indexCreationOptions, partitionKey, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions, string partitionKey, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<Guid>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync<TDocument, Guid>(fields, indexCreationOptions, partitionKey, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>
|
||||
{
|
||||
return await MongoDbIndexHandler.CreateCombinedTextIndexAsync<TDocument, TKey>(fields, indexCreationOptions, partitionKey);
|
||||
return await CreateCombinedTextIndexAsync<TDocument, TKey>(fields, null, null, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task DropIndexAsync<TDocument>(string indexName, string partitionKey = null)
|
||||
where TDocument : IDocument<Guid>
|
||||
{
|
||||
await DropIndexAsync<TDocument, Guid>(indexName, partitionKey);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task DropIndexAsync<TDocument, TKey>(string indexName, string partitionKey = null)
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>
|
||||
{
|
||||
await MongoDbIndexHandler.DropIndexAsync<TDocument, TKey>(indexName, partitionKey);
|
||||
return await CreateCombinedTextIndexAsync<TDocument, TKey>(fields, null, null, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync<TDocument, TKey>(fields, indexCreationOptions, null, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync<TDocument, TKey>(fields, indexCreationOptions, null, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields, string partitionKey)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync<TDocument, TKey>(fields, null, partitionKey, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields, string partitionKey, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync<TDocument, TKey>(fields, null, partitionKey, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions, string partitionKey)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync<TDocument, TKey>(fields, indexCreationOptions, partitionKey, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions, string partitionKey, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>
|
||||
{
|
||||
return await MongoDbIndexHandler.CreateCombinedTextIndexAsync<TDocument, TKey>(fields, indexCreationOptions, partitionKey, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task DropIndexAsync<TDocument>(string indexName)
|
||||
where TDocument : IDocument<Guid>
|
||||
{
|
||||
await DropIndexAsync<TDocument, Guid>(indexName, null, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task DropIndexAsync<TDocument>(string indexName, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<Guid>
|
||||
{
|
||||
await DropIndexAsync<TDocument, Guid>(indexName, null, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task DropIndexAsync<TDocument>(string indexName, string partitionKey)
|
||||
where TDocument : IDocument<Guid>
|
||||
{
|
||||
await DropIndexAsync<TDocument, Guid>(indexName, partitionKey, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task DropIndexAsync<TDocument>(string indexName, string partitionKey, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<Guid>
|
||||
{
|
||||
await DropIndexAsync<TDocument, Guid>(indexName, partitionKey, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task DropIndexAsync<TDocument, TKey>(string indexName)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>
|
||||
{
|
||||
await DropIndexAsync<TDocument, TKey>(indexName, null, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task DropIndexAsync<TDocument, TKey>(string indexName, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>
|
||||
{
|
||||
await DropIndexAsync<TDocument, TKey>(indexName, null, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task DropIndexAsync<TDocument, TKey>(string indexName, string partitionKey)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>
|
||||
{
|
||||
await DropIndexAsync<TDocument, TKey>(indexName, partitionKey, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task DropIndexAsync<TDocument, TKey>(string indexName, string partitionKey, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>
|
||||
{
|
||||
await MongoDbIndexHandler.DropIndexAsync<TDocument, TKey>(indexName, partitionKey, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -520,6 +520,91 @@ namespace MongoDbGenericRepository
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a combined text index.
|
||||
/// IndexCreationOptions can be supplied to further specify
|
||||
/// how the creation should be done.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <param name="fields">The fields we want to index.</param>
|
||||
/// <returns>The result of the create index operation.</returns>
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a combined text index.
|
||||
/// IndexCreationOptions can be supplied to further specify
|
||||
/// how the creation should be done.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <param name="fields">The fields we want to index.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>The result of the create index operation.</returns>
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a combined text index.
|
||||
/// IndexCreationOptions can be supplied to further specify
|
||||
/// how the creation should be done.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <param name="fields">The fields we want to index.</param>
|
||||
/// <param name="indexCreationOptions">Options for creating an index.</param>
|
||||
/// <returns>The result of the create index operation.</returns>
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a combined text index.
|
||||
/// IndexCreationOptions can be supplied to further specify
|
||||
/// how the creation should be done.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <param name="fields">The fields we want to index.</param>
|
||||
/// <param name="indexCreationOptions">Options for creating an index.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>The result of the create index operation.</returns>
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a combined text index.
|
||||
/// IndexCreationOptions can be supplied to further specify
|
||||
/// how the creation should be done.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <param name="fields">The fields we want to index.</param>
|
||||
/// <param name="partitionKey">An optional partition key.</param>
|
||||
/// <returns>The result of the create index operation.</returns>
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields, string partitionKey)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a combined text index.
|
||||
/// IndexCreationOptions can be supplied to further specify
|
||||
/// how the creation should be done.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <param name="fields">The fields we want to index.</param>
|
||||
/// <param name="partitionKey">An optional partition key.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>The result of the create index operation.</returns>
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields, string partitionKey, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a combined text index.
|
||||
/// IndexCreationOptions can be supplied to further specify
|
||||
@@ -531,7 +616,44 @@ namespace MongoDbGenericRepository
|
||||
/// <param name="indexCreationOptions">Options for creating an index.</param>
|
||||
/// <param name="partitionKey">An optional partition key.</param>
|
||||
/// <returns>The result of the create index operation.</returns>
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions = null, string partitionKey = null)
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions, string partitionKey)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a combined text index.
|
||||
/// IndexCreationOptions can be supplied to further specify
|
||||
/// how the creation should be done.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <param name="fields">The fields we want to index.</param>
|
||||
/// <param name="indexCreationOptions">Options for creating an index.</param>
|
||||
/// <param name="partitionKey">An optional partition key.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>The result of the create index operation.</returns>
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument, TKey>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions, string partitionKey, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Drops the index given a field name
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <param name="indexName">The name of the index</param>
|
||||
Task DropIndexAsync<TDocument, TKey>(string indexName)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Drops the index given a field name
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <param name="indexName">The name of the index</param>
|
||||
/// <param name="cancellationToken">The cancellation token</param>
|
||||
Task DropIndexAsync<TDocument, TKey>(string indexName, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -542,7 +664,19 @@ namespace MongoDbGenericRepository
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <param name="indexName">The name of the index</param>
|
||||
/// <param name="partitionKey">An optional partition key</param>
|
||||
Task DropIndexAsync<TDocument, TKey>(string indexName, string partitionKey = null)
|
||||
Task DropIndexAsync<TDocument, TKey>(string indexName, string partitionKey)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Drops the index given a field name
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <param name="indexName">The name of the index</param>
|
||||
/// <param name="partitionKey">An optional partition key</param>
|
||||
/// <param name="cancellationToken">The cancellation token</param>
|
||||
Task DropIndexAsync<TDocument, TKey>(string indexName, string partitionKey, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
}
|
||||
|
||||
@@ -340,17 +340,87 @@ namespace MongoDbGenericRepository
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions = null, string partitionKey = null)
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields)
|
||||
where TDocument : IDocument<TKey>
|
||||
{
|
||||
return await MongoDbIndexHandler.CreateCombinedTextIndexAsync<TDocument, TKey>(fields, indexCreationOptions, partitionKey);
|
||||
return await CreateCombinedTextIndexAsync(fields, null, null, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task DropIndexAsync<TDocument>(string indexName, string partitionKey = null)
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
{
|
||||
await MongoDbIndexHandler.DropIndexAsync<TDocument, TKey>(indexName, partitionKey);
|
||||
return await CreateCombinedTextIndexAsync(fields, null, null, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions)
|
||||
where TDocument : IDocument<TKey>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync(fields, indexCreationOptions, null, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync(fields, indexCreationOptions, null, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, string partitionKey)
|
||||
where TDocument : IDocument<TKey>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync(fields, null, partitionKey, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, string partitionKey, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync(fields, null, partitionKey, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions, string partitionKey)
|
||||
where TDocument : IDocument<TKey>
|
||||
{
|
||||
return await CreateCombinedTextIndexAsync(fields, indexCreationOptions, partitionKey, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions, string partitionKey, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
{
|
||||
return await MongoDbIndexHandler.CreateCombinedTextIndexAsync<TDocument, TKey>(fields, indexCreationOptions, partitionKey, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task DropIndexAsync<TDocument>(string indexName)
|
||||
where TDocument : IDocument<TKey>
|
||||
{
|
||||
await DropIndexAsync<TDocument>(indexName, null, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task DropIndexAsync<TDocument>(string indexName, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
{
|
||||
await DropIndexAsync<TDocument>(indexName, null, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task DropIndexAsync<TDocument>(string indexName, string partitionKey)
|
||||
where TDocument : IDocument<TKey>
|
||||
{
|
||||
await DropIndexAsync<TDocument>(indexName, partitionKey, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual async Task DropIndexAsync<TDocument>(string indexName, string partitionKey, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>
|
||||
{
|
||||
await MongoDbIndexHandler.DropIndexAsync<TDocument, TKey>(indexName, partitionKey, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -450,6 +450,79 @@ namespace MongoDbGenericRepository
|
||||
Task<string> CreateHashedIndexAsync<TDocument>(Expression<Func<TDocument, object>> field, IndexCreationOptions indexCreationOptions, string partitionKey, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a combined text index.
|
||||
/// IndexCreationOptions can be supplied to further specify
|
||||
/// how the creation should be done.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <param name="fields">The fields we want to index.</param>
|
||||
/// <returns>The result of the create index operation.</returns>
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields)
|
||||
where TDocument : IDocument<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a combined text index.
|
||||
/// IndexCreationOptions can be supplied to further specify
|
||||
/// how the creation should be done.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <param name="fields">The fields we want to index.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>The result of the create index operation.</returns>
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a combined text index.
|
||||
/// IndexCreationOptions can be supplied to further specify
|
||||
/// how the creation should be done.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <param name="fields">The fields we want to index.</param>
|
||||
/// <param name="indexCreationOptions">Options for creating an index.</param>
|
||||
/// <returns>The result of the create index operation.</returns>
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions)
|
||||
where TDocument : IDocument<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a combined text index.
|
||||
/// IndexCreationOptions can be supplied to further specify
|
||||
/// how the creation should be done.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <param name="fields">The fields we want to index.</param>
|
||||
/// <param name="indexCreationOptions">Options for creating an index.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>The result of the create index operation.</returns>
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a combined text index.
|
||||
/// IndexCreationOptions can be supplied to further specify
|
||||
/// how the creation should be done.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <param name="fields">The fields we want to index.</param>
|
||||
/// <param name="partitionKey">An optional partition key.</param>
|
||||
/// <returns>The result of the create index operation.</returns>
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, string partitionKey)
|
||||
where TDocument : IDocument<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a combined text index.
|
||||
/// IndexCreationOptions can be supplied to further specify
|
||||
/// how the creation should be done.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <param name="fields">The fields we want to index.</param>
|
||||
/// <param name="partitionKey">An optional partition key.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>The result of the create index operation.</returns>
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, string partitionKey, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a combined text index.
|
||||
/// IndexCreationOptions can be supplied to further specify
|
||||
@@ -460,7 +533,38 @@ namespace MongoDbGenericRepository
|
||||
/// <param name="indexCreationOptions">Options for creating an index.</param>
|
||||
/// <param name="partitionKey">An optional partition key.</param>
|
||||
/// <returns>The result of the create index operation.</returns>
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions = null, string partitionKey = null)
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions, string partitionKey)
|
||||
where TDocument : IDocument<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a combined text index.
|
||||
/// IndexCreationOptions can be supplied to further specify
|
||||
/// how the creation should be done.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <param name="fields">The fields we want to index.</param>
|
||||
/// <param name="indexCreationOptions">Options for creating an index.</param>
|
||||
/// <param name="partitionKey">An optional partition key.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>The result of the create index operation.</returns>
|
||||
Task<string> CreateCombinedTextIndexAsync<TDocument>(IEnumerable<Expression<Func<TDocument, object>>> fields, IndexCreationOptions indexCreationOptions, string partitionKey, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Drops the index given a field name
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <param name="indexName">The name of the index</param>
|
||||
Task DropIndexAsync<TDocument>(string indexName)
|
||||
where TDocument : IDocument<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Drops the index given a field name
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <param name="indexName">The name of the index</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
Task DropIndexAsync<TDocument>(string indexName, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>;
|
||||
|
||||
/// <summary>
|
||||
@@ -469,7 +573,17 @@ namespace MongoDbGenericRepository
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <param name="indexName">The name of the index</param>
|
||||
/// <param name="partitionKey">An optional partition key</param>
|
||||
Task DropIndexAsync<TDocument>(string indexName, string partitionKey = null)
|
||||
Task DropIndexAsync<TDocument>(string indexName, string partitionKey)
|
||||
where TDocument : IDocument<TKey>;
|
||||
|
||||
/// <summary>
|
||||
/// Drops the index given a field name
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <param name="indexName">The name of the index</param>
|
||||
/// <param name="partitionKey">An optional partition key</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
Task DropIndexAsync<TDocument>(string indexName, string partitionKey, CancellationToken cancellationToken)
|
||||
where TDocument : IDocument<TKey>;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user