Exemplo n.º 1
0
        public async Task Handle(DomainEventNotification <DocumentUpdatedEvent> notification, CancellationToken cancellationToken = default)
        {
            var ev = notification.Event;

            var blob = await _db.Blobs.FirstOrDefaultAsync(e => e.Path == ev.Path.Value);

            blob.DocumentId   = ev.Entity.Id;
            blob.StorageKey   = ev.Data.StorageKey;
            blob.ContentType  = ev.ContentType;
            blob.FileSize     = ev.Data.Length;
            blob.Hash         = ev.Data.Hash;
            blob.Created      = ev.Created;
            blob.LastModified = ev.LastModified;

            _db.Update(blob);
            await _db.SaveChangesAsync();
        }
Exemplo n.º 2
0
 public Task UpdateAsync(Document document)
 {
     _context.Update(document);
     return(Task.CompletedTask);
 }