Muokkaa

Jaa


RuntimeTransactionHandle.RequireTransactionContext Method

Definition

Initiates the creation of a NativeActivityTransactionContext for use with an existing transaction.

public:
 void RequireTransactionContext(System::Activities::NativeActivityContext ^ context, Action<System::Activities::NativeActivityTransactionContext ^, System::Object ^> ^ callback, System::Object ^ state);
public void RequireTransactionContext (System.Activities.NativeActivityContext context, Action<System.Activities.NativeActivityTransactionContext,object> callback, object state);
member this.RequireTransactionContext : System.Activities.NativeActivityContext * Action<System.Activities.NativeActivityTransactionContext, obj> * obj -> unit
Public Sub RequireTransactionContext (context As NativeActivityContext, callback As Action(Of NativeActivityTransactionContext, Object), state As Object)

Parameters

context
NativeActivityContext

The current execution environment.

callback
Action<NativeActivityTransactionContext,Object>

The method to be called when the NativeActivityTransactionContext is created.

state
Object

An optional user-provided state that contains information about the request.

Remarks

This method is used when the activity has a transaction that it requires the runtime to use. The workflow cannot persist between a call to RequireTransactionContext and the subsequent callback. Calling RequireTransactionContext again before the first call completes is not allowed and all calls after the first call result in exceptions. This method allows transactions flowed in from the host to be provided to the runtime without risking an intermediate persistence point. The state object that can be serialized is not necessary because the instance is guaranteed not to persist when this method is used.

Applies to