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); } }
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); } }