using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; using MongoDbGenericRepository.Models; namespace MongoDbGenericRepository { /// /// The base Mongo Repository Delete interface. used to delete documents from the collections. /// public interface IBaseMongoRepository_Delete : IBaseMongoRepository_Delete { /// /// Deletes a document. /// /// The type representing a Document. /// The type of the primary key for a Document. /// The document you want to delete. /// The number of documents deleted. long DeleteOne(TDocument document) where TDocument : IDocument where TKey : IEquatable; /// /// Asynchronously deletes a document matching the condition of the LINQ expression filter. /// /// The type representing a Document. /// The type of the primary key for a Document. /// The document you want to delete. /// The number of documents deleted. Task DeleteOneAsync(TDocument document) where TDocument : IDocument where TKey : IEquatable; /// /// Asynchronously deletes a document matching the condition of the LINQ expression filter. /// /// The type representing a Document. /// The type of the primary key for a Document. /// The document you want to delete. /// The Cancellation token /// The number of documents deleted. Task DeleteOneAsync(TDocument document, CancellationToken cancellationToken) where TDocument : IDocument where TKey : IEquatable; /// /// Deletes a document matching the condition of the LINQ expression filter. /// /// The type representing a Document. /// The type of the primary key for a Document. /// A LINQ expression filter. /// An optional partition key. /// The number of documents deleted. long DeleteOne(Expression> filter, string partitionKey = null) where TDocument : IDocument where TKey : IEquatable; /// /// Asynchronously deletes a document matching the condition of the LINQ expression filter. /// /// The type representing a Document. /// The type of the primary key for a Document. /// A LINQ expression filter. /// The number of documents deleted. Task DeleteOneAsync(Expression> filter) where TDocument : IDocument where TKey : IEquatable; /// /// Asynchronously deletes a document matching the condition of the LINQ expression filter. /// /// The type representing a Document. /// The type of the primary key for a Document. /// A LINQ expression filter. /// The cancellation token. /// The number of documents deleted. Task DeleteOneAsync(Expression> filter, CancellationToken cancellationToken) where TDocument : IDocument where TKey : IEquatable; /// /// Asynchronously deletes a document matching the condition of the LINQ expression filter. /// /// The type representing a Document. /// The type of the primary key for a Document. /// A LINQ expression filter. /// An optional partition key. /// The number of documents deleted. Task DeleteOneAsync(Expression> filter, string partitionKey) where TDocument : IDocument where TKey : IEquatable; /// /// Asynchronously deletes a document matching the condition of the LINQ expression filter. /// /// The type representing a Document. /// The type of the primary key for a Document. /// A LINQ expression filter. /// An optional partition key. /// The cancellation token. /// The number of documents deleted. Task DeleteOneAsync(Expression> filter, string partitionKey, CancellationToken cancellationToken) where TDocument : IDocument where TKey : IEquatable; /// /// Asynchronously deletes the documents matching the condition of the LINQ expression filter. /// /// The type representing a Document. /// The type of the primary key for a Document. /// A LINQ expression filter. /// The number of documents deleted. Task DeleteManyAsync(Expression> filter) where TDocument : IDocument where TKey : IEquatable; /// /// Asynchronously deletes the documents matching the condition of the LINQ expression filter. /// /// The type representing a Document. /// The type of the primary key for a Document. /// A LINQ expression filter. /// The cancellation token. /// The number of documents deleted. Task DeleteManyAsync(Expression> filter, CancellationToken cancellationToken) where TDocument : IDocument where TKey : IEquatable; /// /// Asynchronously deletes the documents matching the condition of the LINQ expression filter. /// /// The type representing a Document. /// The type of the primary key for a Document. /// A LINQ expression filter. /// An optional partition key. /// The number of documents deleted. Task DeleteManyAsync(Expression> filter, string partitionKey) where TDocument : IDocument where TKey : IEquatable; /// /// Asynchronously deletes the documents matching the condition of the LINQ expression filter. /// /// The type representing a Document. /// The type of the primary key for a Document. /// A LINQ expression filter. /// An optional partition key. /// The cancellation token. /// The number of documents deleted. Task DeleteManyAsync(Expression> filter, string partitionKey, CancellationToken cancellationToken) where TDocument : IDocument where TKey : IEquatable; /// /// Asynchronously deletes a list of documents. /// /// The type representing a Document. /// The type of the primary key for a Document. /// The list of documents to delete. /// The number of documents deleted. Task DeleteManyAsync(IEnumerable documents) where TDocument : IDocument where TKey : IEquatable; /// /// Asynchronously deletes a list of documents. /// /// The type representing a Document. /// The type of the primary key for a Document. /// The list of documents to delete. /// The cancellation token. /// The number of documents deleted. Task DeleteManyAsync(IEnumerable documents, CancellationToken cancellationToken) where TDocument : IDocument where TKey : IEquatable; /// /// Deletes a list of documents. /// /// The type representing a Document. /// The type of the primary key for a Document. /// The list of documents to delete. /// The number of documents deleted. long DeleteMany(IEnumerable documents) where TDocument : IDocument where TKey : IEquatable; /// /// Deletes the documents matching the condition of the LINQ expression filter. /// /// The type representing a Document. /// The type of the primary key for a Document. /// A LINQ expression filter. /// An optional partition key. /// The number of documents deleted. long DeleteMany(Expression> filter, string partitionKey = null) where TDocument : IDocument where TKey : IEquatable; } }