public async Task AddDocument(Document document, byte[] file) { if (document == null) { throw new ArgumentNullException(nameof(document), "Document should not be null"); } await _repository.AddDocument(document, file); DocumentAccessHistory accessHistory = GetAccessDetails(document.DocumentId, document.DocumentId, document.CreatedBy, AccessLog.Created); await _accessRepository.InsertDocumentAccessLog(accessHistory); }
public async Task InsertDocumentAccessLog(DocumentAccessHistory documentAccessHistory) { // Throws null exception if company value is null if (documentAccessHistory == null) { throw new ArgumentNullException(nameof(documentAccessHistory), "Document Access History should not be null"); } // returns new company with DepartmentId await _repository.InsertDocumentAccessLog(documentAccessHistory); }