Example #1
0
 public void On(UpdateEvent e)
 {
     _collection.FindAndModify(e, x => x.Id == e.AggregateId, m =>
     {
         m.Text = e.Text;
     });
 }
 /// <summary>
 /// Need to maintain the chain of the attachment.
 /// </summary>
 /// <param name="e"></param>
 public void On(DocumentDescriptorCreated e)
 {
     _documents.FindAndModify(e, (DocumentDescriptorId)e.AggregateId, d =>
     {
         d.Created = true;
     });
 }
        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;
                });
            }
        }