TransactionScope Constructor ()

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Initializes a new instance of the TransactionScope class.

Namespace:   System.Activities.Statements
Assembly:  System.Activities (in System.Activities.dll)

public TransactionScope()

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" },

.NET Framework
Available since 4.0
Return to top