C# Class Rebus.Transport.AmbientTransactionContext

Provides an "ambient" context for stashing away an instance that implements the current ITransactionContext. The ambient transaction context is automatically preserved even though threads are changed etc.
Exibir arquivo Open project: rebus-org/Rebus Class Usage Examples

Public Properties

Property Type Description
DefaultGetter Func
DefaultSetter Action

Public Methods

Method Description
SetAccessors ( Action setter, Func getter ) : void

Sets the accessor functions used by Rebus to set the current transaction when executing handlers and getting the context by picking it up when sending messages

SetCurrent ( ITransactionContext transactionContext ) : void

Sets the current transaction context. Please note that in most cases, it is not necessary to set the context using this method - when using DefaultTransactionContextScope and DefaultSyncTransactionContextScope the ambient transaction context is automatically set/unset when the object is created/disposed.

Method Details

SetAccessors() public static method

Sets the accessor functions used by Rebus to set the current transaction when executing handlers and getting the context by picking it up when sending messages
public static SetAccessors ( Action setter, Func getter ) : void
setter Action
getter Func
return void

SetCurrent() public static method

Sets the current transaction context. Please note that in most cases, it is not necessary to set the context using this method - when using DefaultTransactionContextScope and DefaultSyncTransactionContextScope the ambient transaction context is automatically set/unset when the object is created/disposed.
public static SetCurrent ( ITransactionContext transactionContext ) : void
transactionContext ITransactionContext
return void

Property Details

DefaultGetter public_oe static_oe property

Gets the default set function (which is using CallContext.LogicalGetData to do its thing)
public static Func DefaultGetter
return Func

DefaultSetter public_oe static_oe property

Gets the default set function (which is using CallContext.LogicalSetData to do its thing)
public static Action DefaultSetter
return Action