TransactionScope TransactionScope TransactionScope Constructor

Definition

Initializes a new instance of the TransactionScope class.

public:
 TransactionScope();
public TransactionScope ();
Public Sub New ()

Examples

The following code sample demonstrates creating a TransactionScope activity. This example is from the Basic TransactionScope sample.

new TransactionScope
{
    Body = new Sequence
    {
        Activities = 
        {
            new WriteLine { Text = "    Begin TransactionScope" },

            new PrintTransactionId(),
            
            new TransactionScopeTest(),

            new WriteLine { Text = "    End TransactionScope" },
        },
    },
},

Applies to