Exemplo n.º 1
0
 public async Task RollbackAsync(IServiceScopeFactory serviceScopeFactory)
 {
     using (var scope = serviceScopeFactory.CreateScope())
     {
         ITransactionMethodInvoker tccTransactionMethodInvoker = scope.ServiceProvider.GetRequiredService <ITransactionMethodInvoker>();
         await tccTransactionMethodInvoker.InvokeAsync(new TransactionContext(Xid, TransactionStatus.CANCELLING), CancelInvocationContext);
     }
 }
Exemplo n.º 2
0
 public async Task CommitAsync(IServiceScopeFactory serviceScopeFactory)
 {
     using (var scope = serviceScopeFactory.CreateScope())
     {
         ITransactionMethodInvoker tccTransactionMethodInvoker = scope.ServiceProvider.GetRequiredService <ITransactionMethodInvoker>();
         await tccTransactionMethodInvoker.InvokeAsync(new TransactionContext(Xid, TransactionStatus.CONFIRMING), ConfirmInvocationContext);
     }
 }