/// <summary> /// Disposes the transaction context and removes it from <see cref="AmbientTransactionContext.Current"/> again /// </summary> public void Dispose() { try { _transactionContext?.Dispose(); } finally { AmbientTransactionContext.SetCurrent(null); } }
/// <summary> /// Creates a new transaction context and mounts it on <see cref="AmbientTransactionContext.Current"/>, making it available for Rebus /// to pick up /// </summary> public DefaultTransactionContextScope() { AmbientTransactionContext.SetCurrent(_transactionContext); }
/// <summary> /// Creates a new transaction context and mounts it on <see cref="AmbientTransactionContext.Current"/>, making it available for Rebus /// to pick up. The context can also be retrieved simply via <see cref="TransactionContext"/> /// </summary> public RebusTransactionScope() { AmbientTransactionContext.SetCurrent(_transactionContext); }
/// <summary> /// Creates a new transaction context and mounts it on <see cref="AmbientTransactionContext.Current"/>, making it available for Rebus /// to pick up. The context can also be retrieved simply via <see cref="TransactionContext"/> /// </summary> public RebusTransactionScope() { _previousTransactionContext = AmbientTransactionContext.Current; AmbientTransactionContext.SetCurrent(_transactionContext); }