TransactionScope 建構函式

定義

初始化 TransactionScope 類別的新執行個體。

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

範例

下列程式碼範例將示範如何建立 TransactionScope 活動。

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

            new PrintTransactionId(),

            new TransactionScopeTest(),

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

適用於