using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using MongoDbGenericRepository.Models; namespace MongoDbGenericRepository { /// /// The IBaseMongoRepository_Create interface to expose document creation functionality /// with document having an Id of type Guid. /// public interface IBaseMongoRepository_Create : IBaseMongoRepository_Create { /// /// Asynchronously adds a document to the collection. /// Populates the Id and AddedAtUtc fields if necessary. /// /// The type representing a Document. /// The type of the primary key for a Document. /// The document you want to add. Task AddOneAsync(TDocument document) where TDocument : IDocument where TKey : IEquatable; /// /// Asynchronously adds a document to the collection. /// Populates the Id and AddedAtUtc fields if necessary. /// /// The type representing a Document. /// The type of the primary key for a Document. /// The document you want to add. /// An optional cancellation Token. Task AddOneAsync(TDocument document, CancellationToken cancellationToken) where TDocument : IDocument where TKey : IEquatable; /// /// Adds a document to the collection. /// Populates the Id and AddedAtUtc fields if necessary. /// /// The type representing a Document. /// The type of the primary key for a Document. /// The document you want to add. void AddOne(TDocument document) where TDocument : IDocument where TKey : IEquatable; /// /// Adds a document to the collection. /// Populates the Id and AddedAtUtc fields if necessary. /// /// The type representing a Document. /// The type of the primary key for a Document. /// The document you want to add. /// The cancellation token. void AddOne(TDocument document, CancellationToken cancellationToken) where TDocument : IDocument where TKey : IEquatable; /// /// Asynchronously adds a list of documents to the collection. /// Populates the Id and AddedAtUtc fields if necessary. /// /// The type representing a Document. /// The type of the primary key for a Document. /// The documents you want to add. Task AddManyAsync(IEnumerable documents) where TDocument : IDocument where TKey : IEquatable; /// /// Asynchronously adds a list of documents to the collection. /// Populates the Id and AddedAtUtc fields if necessary. /// /// The type representing a Document. /// The type of the primary key for a Document. /// The documents you want to add. /// An optional cancellation Token. Task AddManyAsync(IEnumerable documents, CancellationToken cancellationToken) where TDocument : IDocument where TKey : IEquatable; /// /// Adds a list of documents to the collection. /// Populates the Id and AddedAtUtc fields if necessary. /// /// The type representing a Document. /// The type of the primary key for a Document. /// The documents you want to add. void AddMany(IEnumerable documents) where TDocument : IDocument where TKey : IEquatable; /// /// Adds a list of documents to the collection. /// Populates the Id and AddedAtUtc fields if necessary. /// /// The type representing a Document. /// The type of the primary key for a Document. /// The documents you want to add. /// The cancellation token void AddMany(IEnumerable documents, CancellationToken cancellationToken) where TDocument : IDocument where TKey : IEquatable; } }