using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using LCU.API.Internal.DocumentLib.Containers; using LCU.API.Internal.DocumentLib.Utilities; using MongoDB.Driver; namespace LCU.API.Internal.DocumentLib.Repositories; public class DocumentAuditRepository : IDocumentAuditRepository { private readonly IMongoCollection _documentAudits; public DocumentAuditRepository(IMongoCollectionFactory collectionFactory) { _documentAudits = collectionFactory.GetCollection(); } public async Task> GetDocumentAudits(params Guid[] documentIds) { return await (await _documentAudits.FindAsync(doc => documentIds.Contains(doc.DocumentId))).ToListAsync(); } public async Task> SaveDocumentAudits(params DocumentAudit[] documentAudit) { await _documentAudits.InsertManyAsync(documentAudit); return documentAudit; } }