using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using MongoDB.Driver;
using MongoDbGenericRepository.Models;
namespace MongoDbGenericRepository
{
///
/// The IBaseMongoRepository interface exposes the CRUD functionality of the BaseMongoRepository.
///
public interface IBaseMongoRepository :
IReadOnlyMongoRepository,
IBaseMongoRepository_Create,
IBaseMongoRepository_Update,
IBaseMongoRepository_Delete,
IBaseMongoRepository_Index
{
///
/// Asynchronously returns a paginated list of the documents matching the filter condition.
///
/// The type representing a Document.
///
/// The number of documents you want to skip. Default value is 0.
/// The number of documents you want to take. Default value is 50.
/// An optional partition key.
/// An optional cancellation token.
Task> GetPaginatedAsync(
Expression> filter,
int skipNumber = 0,
int takeNumber = 50,
string partitionKey = null,
CancellationToken cancellationToken = default)
where TDocument : IDocument;
///
/// Asynchronously returns a paginated list of the documents matching the filter condition.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
///
/// The number of documents you want to skip. Default value is 0.
/// The number of documents you want to take. Default value is 50.
/// An optional partition key.
/// An optional cancellation token.
Task> GetPaginatedAsync(
Expression> filter,
int skipNumber = 0,
int takeNumber = 50,
string partitionKey = null,
CancellationToken cancellationToken = default)
where TDocument : IDocument
where TKey : IEquatable;
///
/// GetAndUpdateOne with filter
///
/// The type representing a Document.
///
///
///
///
Task GetAndUpdateOne(
FilterDefinition filter,
UpdateDefinition update,
FindOneAndUpdateOptions options)
where TDocument : IDocument;
///
/// GetAndUpdateOne with filter
///
/// The type representing a Document.
///
///
///
/// The cancellation token.
///
Task GetAndUpdateOne(
FilterDefinition filter,
UpdateDefinition update,
FindOneAndUpdateOptions options,
CancellationToken cancellationToken)
where TDocument : IDocument;
///
/// GetAndUpdateOne with filter
///
/// The type representing a Document.
/// The type of the primary key for a Document.
///
///
///
///
Task GetAndUpdateOne(
FilterDefinition filter,
UpdateDefinition update,
FindOneAndUpdateOptions options)
where TDocument : IDocument
where TKey : IEquatable;
///
/// GetAndUpdateOne with filter
///
/// The type representing a Document.
/// The type of the primary key for a Document.
///
///
///
/// The cancellation token.
///
Task GetAndUpdateOne(
FilterDefinition filter,
UpdateDefinition update,
FindOneAndUpdateOptions options,
CancellationToken cancellationToken)
where TDocument : IDocument
where TKey : IEquatable;
}
}