Files
2026-03-13 09:11:35 -05:00

31 lines
1003 B
C#

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<DocumentAudit> _documentAudits;
public DocumentAuditRepository(IMongoCollectionFactory collectionFactory)
{
_documentAudits = collectionFactory.GetCollection<DocumentAudit>();
}
public async Task<List<DocumentAudit>> GetDocumentAudits(params Guid[] documentIds)
{
return await (await _documentAudits.FindAsync(doc => documentIds.Contains(doc.DocumentId))).ToListAsync();
}
public async Task<IEnumerable<DocumentAudit>> SaveDocumentAudits(params DocumentAudit[] documentAudit)
{
await _documentAudits.InsertManyAsync(documentAudit);
return documentAudit;
}
}