Ejemplo n.º 1
0
 public async Task Handle(CompleteTransfer completeTransfer, IMessageHandlerContext context)
 {
     try
     {
         log.Info($"CompleteTransferHandler, TransferId = {completeTransfer.TransactionId}");
         var nHibernateSession = context.SynchronizedStorageSession.Session();
         var transactionId = TransactionId.FromExisting(completeTransfer.TransactionId);
         var transaction = nHibernateSession.Get<Transaction>(transactionId) ?? Transaction.NonExisting();
         if (transaction.DoesNotExist())
         {
             return;
         }
         transaction.Complete();
         transaction.ChangeUpdatedAt();
         nHibernateSession.Save(transaction);
         var transferCompleted = new TransferCompleted
         (
             completeTransfer.TransactionId
         );
         await context.Publish(transferCompleted);
     }
     catch (Exception ex)
     {
         log.Error(ex.Message + " ** " + ex.StackTrace);
     }
 }
Ejemplo n.º 2
0
 public void Handle(TransferCompleted c)
 {
     _store.UpdateTransfer(c.AggregateIdentifier, c.Status.ToString(), null);
 }