Beispiel #1
0
        public Document(DocumentPath path, string contentType, IData data, DateTime created, DateTime lastModified)
        {
            Path        = (path ?? throw new ArgumentNullException(nameof(path))).Value;
            ContentType = contentType ?? throw new ArgumentNullException(nameof(contentType));
            StorageKey  = data?.StorageKey ?? throw new ArgumentNullException(nameof(data.StorageKey));
            FileSize    = data?.Length ?? throw new ArgumentNullException(nameof(data));
            Hash        = data.Hash ?? throw new ArgumentNullException(nameof(data.Hash));

            Created      = created;
            LastModified = lastModified;

            OnDocumentCreated(path, StorageKey, ContentType, data, Created, LastModified);
        }
Beispiel #2
0
 public Document(DocumentPath path, string contentType, IData data, DateTime created)
     : this(path, contentType, data, created, created)
 {
 }
Beispiel #3
0
 public Document(DocumentPath path, string contentType, IData data)
     : this(path, contentType, data, DateTime.UtcNow)
 {
 }
Beispiel #4
0
        private void OnDocumentDeleted(DocumentPath path)
        {
            var ev = new DocumentDeletedEvent(this, path);

            AddDomainEvent(ev);
        }
Beispiel #5
0
        private void OnDocumentMoved(DocumentPath originalPath, DocumentPath destinationPath)
        {
            var ev = new DocumentMovedEvent(this, originalPath, destinationPath);

            AddDomainEvent(ev);
        }
Beispiel #6
0
        private void OnDocumentCreated(DocumentPath path, string storageKey, string contentType, IData data, DateTime created, DateTime lastModified)
        {
            var ev = new DocumentCreatedEvent(this, path, storageKey, contentType, data, created, lastModified);

            AddDomainEvent(ev);
        }