Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }