public void On(DocumentDescriptorDeleted e)
 {
     _streamReadModelCollection.Insert(e, new StreamReadModel()
     {
         Id = GetNewId(),
         DocumentDescriptorId = (DocumentDescriptorId)e.AggregateId,
         EventType            = HandleStreamEventTypes.DocumentDescriptorDeleted
     });
 }
        public void On(DocumentDescriptorDeleted e)
        {
            var descriptor = _blobStore.GetDescriptor(e.BlobId);

            if (descriptor != null)
            {
                _collection.FindAndModify(e, descriptor.FileNameWithExtension.Extension,
                                          s =>
                {
                    s.Files--;
                    s.Bytes -= descriptor.Length;
                });
            }
        }
Exemple #3
0
        public void On(DocumentDescriptorDeleted e)
        {
            if (IsReplay)
            {
                return;
            }

            if (e.Attachments != null && e.Attachments.Length > 0)
            {
                //delete all orphaned attachments
                foreach (var attachment in e.Attachments)
                {
                    _commandBus.Send(new DeleteDocument(attachment)
                                     .WithDiagnosticTriggeredByInfo(e, string.Format("Delete orphaned attachment {0} belonging to dleted descriptor {1}",
                                                                                     attachment, e.AggregateId))
                                     );
                }
            }
        }
 public void On(DocumentDescriptorDeleted e)
 {
     _documents.Delete(e, (DocumentDescriptorId)e.AggregateId);
 }
 private void When(DocumentDescriptorDeleted e)
 {
     HasBeenDeleted = true;
 }