TransactionScope Constructor ()

.NET Framework (current version)
 

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
Show: