TransactionScope 建構函式

定義

初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class.

多載

TransactionScope()

初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class.

TransactionScope(Transaction)

初始化 TransactionScope 類別的新執行個體,並將指定的異動設定為環境異動,以便在範圍內執行的異動式工作使用這個異動。Initializes a new instance of the TransactionScope class and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

TransactionScope(Transaction, TransactionScopeAsyncFlowOption)

[在 .NET Framework 4.5.1 及更新版本中支援][Supported in the .NET Framework 4.5.1 and later versions] 初始化 TransactionScope 類別的新執行個體,並將指定的異動設定為環境異動,以便在範圍內執行的異動式工作使用這個異動。Initializes a new instance of the TransactionScope class and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

TransactionScope(TransactionScopeAsyncFlowOption)

使用指定的非同步流程選項,初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class with the specified asynchronous flow option.

TransactionScope(TransactionScopeOption)

使用指定的需求,初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class with the specified requirements.

TransactionScope(Transaction, TimeSpan, TransactionScopeAsyncFlowOption)

[在 .NET Framework 4.5.1 及更新版本中支援][Supported in the .NET Framework 4.5.1 and later versions] 使用指定的逾時值,初始化 TransactionScope 類別的新執行個體,並將指定的異動設定為環境異動,以便在範圍內執行的異動式工作使用這個異動。Initializes a new instance of the TransactionScope class with the specified timeout value, and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

TransactionScope(TransactionScopeOption, TransactionOptions)

使用指定的需求,初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class with the specified requirements.

TransactionScope(TransactionScopeOption, TransactionOptions, TransactionScopeAsyncFlowOption)

[在 .NET Framework 4.5.1 及更新版本中支援][Supported in the .NET Framework 4.5.1 and later versions] 使用指定的需求和非同步流程選項,初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class with the specified requirements and asynchronous flow option.

TransactionScope(Transaction, TimeSpan)

使用指定的逾時值,初始化 TransactionScope 類別的新執行個體,並將指定的異動設定為環境異動,以便在範圍內執行的異動式工作使用這個異動。Initializes a new instance of the TransactionScope class with the specified timeout value, and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

TransactionScope(TransactionScopeOption, TimeSpan)

使用指定的逾時值和需求,初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class with the specified timeout value and requirements.

TransactionScope(TransactionScopeOption, TransactionScopeAsyncFlowOption)

使用指定的需求和非同步流程選項,初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class with the specified requirements and asynchronous flow option.

TransactionScope(TransactionScopeOption, TransactionOptions, EnterpriseServicesInteropOption)

使用指定的範圍和 COM+ 互通性需求,以及異動選項,初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class with the specified scope and COM+ interoperability requirements, and transaction options.

TransactionScope(Transaction, TimeSpan, EnterpriseServicesInteropOption)

使用指定的逾時值和 COM+ 互通性需求,初始化 TransactionScope 類別的新執行個體,並將指定的異動設定為環境異動,以便在範圍內執行的異動式工作使用這個異動。Initializes a new instance of the TransactionScope class with the specified timeout value and COM+ interoperability requirements, and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

TransactionScope(TransactionScopeOption, TimeSpan, TransactionScopeAsyncFlowOption)

使用指定的逾時值、需求和非同步流程選項,初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class with the specified timeout value, requirements, and asynchronous flow option.

TransactionScope()

初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class.

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

備註

此函式會建立新的交易範圍,並將交易範圍Required選項設為等於。This constructor creates a new transaction scope with the transaction scope option equal to Required. 這表示新的範圍需要交易,而且如果其中一個已存在,就會使用環境交易。This means that a transaction is required by the new scope and the ambient transaction is used if one already exists. 否則會在進入範圍前建立新的交易。Otherwise, it creates a new transaction before entering the scope.

另請參閱

TransactionScope(Transaction)

初始化 TransactionScope 類別的新執行個體,並將指定的異動設定為環境異動,以便在範圍內執行的異動式工作使用這個異動。Initializes a new instance of the TransactionScope class and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

public:
 TransactionScope(System::Transactions::Transaction ^ transaction);
public TransactionScope (System.Transactions.Transaction transaction);
new System.Transactions.TransactionScope : System.Transactions.Transaction -> System.Transactions.TransactionScope
Public Sub New (transactionToUse As Transaction)

參數

transactionToUse
Transaction

要設定為環境異動的異動,以便在範圍內執行的異動式工作使用這個異動。The transaction to be set as the ambient transaction, so that transactional work done inside the scope uses this transaction.

另請參閱

TransactionScope(Transaction, TransactionScopeAsyncFlowOption)

[在 .NET Framework 4.5.1 及更新版本中支援][Supported in the .NET Framework 4.5.1 and later versions] 初始化 TransactionScope 類別的新執行個體,並將指定的異動設定為環境異動,以便在範圍內執行的異動式工作使用這個異動。Initializes a new instance of the TransactionScope class and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

public:
 TransactionScope(System::Transactions::Transaction ^ transactionToUse, System::Transactions::TransactionScopeAsyncFlowOption asyncFlowOption);
public TransactionScope (System.Transactions.Transaction transactionToUse, System.Transactions.TransactionScopeAsyncFlowOption asyncFlowOption);
new System.Transactions.TransactionScope : System.Transactions.Transaction * System.Transactions.TransactionScopeAsyncFlowOption -> System.Transactions.TransactionScope
Public Sub New (transactionToUse As Transaction, asyncFlowOption As TransactionScopeAsyncFlowOption)

參數

transactionToUse
Transaction

要設定為環境異動的異動,以便在範圍內執行的異動式工作使用這個異動。The transaction to be set as the ambient transaction, so that transactional work done inside the scope uses this transaction.

asyncFlowOption
TransactionScopeAsyncFlowOption

TransactionScopeAsyncFlowOption 列舉執行個體,這個執行個體描述異動範圍相關聯的環境異動是否會在使用 Task 或 async/await .NET 非同步程式設計模式時,跨執行緒接續流動。An instance of the TransactionScopeAsyncFlowOption enumeration that describes whether the ambient transaction associated with the transaction scope will flow across thread continuations when using Task or async/await .NET async programming patterns.

TransactionScope(TransactionScopeAsyncFlowOption)

使用指定的非同步流程選項,初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class with the specified asynchronous flow option.

public:
 TransactionScope(System::Transactions::TransactionScopeAsyncFlowOption asyncFlow);
public TransactionScope (System.Transactions.TransactionScopeAsyncFlowOption asyncFlow);
new System.Transactions.TransactionScope : System.Transactions.TransactionScopeAsyncFlowOption -> System.Transactions.TransactionScope
Public Sub New (asyncFlow As TransactionScopeAsyncFlowOption)

參數

asyncFlowOption
TransactionScopeAsyncFlowOption

TransactionScopeAsyncFlowOption 列舉執行個體,這個執行個體描述異動範圍相關聯的環境異動是否會在使用 Task 或 async/await .NET 非同步程式設計模式時,跨執行緒接續流動。An instance of the TransactionScopeAsyncFlowOption enumeration that describes whether the ambient transaction associated with the transaction scope will flow across thread continuations when using Task or async/await .NET async programming patterns.

TransactionScope(TransactionScopeOption)

使用指定的需求,初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class with the specified requirements.

public:
 TransactionScope(System::Transactions::TransactionScopeOption option);
public TransactionScope (System.Transactions.TransactionScopeOption option);
new System.Transactions.TransactionScope : System.Transactions.TransactionScopeOption -> System.Transactions.TransactionScope
Public Sub New (option As TransactionScopeOption)

參數

scopeOption
TransactionScopeOption

TransactionScopeOption 列舉的執行個體,會描述與此異動範圍有關聯的異動需求。An instance of the TransactionScopeOption enumeration that describes the transaction requirements associated with this transaction scope.

另請參閱

TransactionScope(Transaction, TimeSpan, TransactionScopeAsyncFlowOption)

[在 .NET Framework 4.5.1 及更新版本中支援][Supported in the .NET Framework 4.5.1 and later versions] 使用指定的逾時值,初始化 TransactionScope 類別的新執行個體,並將指定的異動設定為環境異動,以便在範圍內執行的異動式工作使用這個異動。Initializes a new instance of the TransactionScope class with the specified timeout value, and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

public:
 TransactionScope(System::Transactions::Transaction ^ transactionToUse, TimeSpan scopeTimeout, System::Transactions::TransactionScopeAsyncFlowOption asyncFlowOption);
public TransactionScope (System.Transactions.Transaction transactionToUse, TimeSpan scopeTimeout, System.Transactions.TransactionScopeAsyncFlowOption asyncFlowOption);
new System.Transactions.TransactionScope : System.Transactions.Transaction * TimeSpan * System.Transactions.TransactionScopeAsyncFlowOption -> System.Transactions.TransactionScope
Public Sub New (transactionToUse As Transaction, scopeTimeout As TimeSpan, asyncFlowOption As TransactionScopeAsyncFlowOption)

參數

transactionToUse
Transaction

要設定為環境異動的異動,以便在範圍內執行的異動式工作使用這個異動。The transaction to be set as the ambient transaction, so that transactional work done inside the scope uses this transaction.

scopeTimeout
TimeSpan

TimeSpan 之後,異動範圍將逾時而中止異動。The TimeSpan after which the transaction scope times out and aborts the transaction.

asyncFlowOption
TransactionScopeAsyncFlowOption

TransactionScopeAsyncFlowOption 列舉執行個體,這個執行個體描述異動範圍相關聯的環境異動是否會在使用 Task 或 async/await .NET 非同步程式設計模式時,跨執行緒接續流動。An instance of the TransactionScopeAsyncFlowOption enumeration that describes whether the ambient transaction associated with the transaction scope will flow across thread continuations when using Task or async/await .NET async programming patterns.

TransactionScope(TransactionScopeOption, TransactionOptions)

使用指定的需求,初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class with the specified requirements.

public:
 TransactionScope(System::Transactions::TransactionScopeOption scopeOption, System::Transactions::TransactionOptions options);
public TransactionScope (System.Transactions.TransactionScopeOption scopeOption, System.Transactions.TransactionOptions options);
new System.Transactions.TransactionScope : System.Transactions.TransactionScopeOption * System.Transactions.TransactionOptions -> System.Transactions.TransactionScope
Public Sub New (scopeOption As TransactionScopeOption, options As TransactionOptions)

參數

scopeOption
TransactionScopeOption

TransactionScopeOption 列舉的執行個體,會描述與此異動範圍有關聯的異動需求。An instance of the TransactionScopeOption enumeration that describes the transaction requirements associated with this transaction scope.

transactionOptions
TransactionOptions

TransactionOptions 結構,描述建立新異動時要使用的異動選項。A TransactionOptions structure that describes the transaction options to use if a new transaction is created. 如果使用現有的異動,則這個參數中的逾時值會套用至異動範圍。If an existing transaction is used, the timeout value in this parameter applies to the transaction scope. 如果該時間在處置範圍之前過期,則會中止異動。If that time expires before the scope is disposed, the transaction is aborted.

備註

當您使用transactionOptions參數來IsolationLevel指定,而且範圍稍後會建立交易時,新的交易會與指定的隔離等級相關聯。When you use the transactionOptions parameter to specify an IsolationLevel, and the scope creates a transaction later, the new transaction is associated with the specified isolation level. 如果隔離等級與交易一起傳入,則交易必須具有相同的隔離等級,否則會擲回例外狀況。If an isolation level is passed in together with a transaction, the transaction must have an identical isolation level, or an exception is thrown.

另請參閱

TransactionScope(TransactionScopeOption, TransactionOptions, TransactionScopeAsyncFlowOption)

[在 .NET Framework 4.5.1 及更新版本中支援][Supported in the .NET Framework 4.5.1 and later versions] 使用指定的需求和非同步流程選項,初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class with the specified requirements and asynchronous flow option.

public:
 TransactionScope(System::Transactions::TransactionScopeOption scopeOption, System::Transactions::TransactionOptions transactionOptions, System::Transactions::TransactionScopeAsyncFlowOption asyncFlowOption);
public TransactionScope (System.Transactions.TransactionScopeOption scopeOption, System.Transactions.TransactionOptions transactionOptions, System.Transactions.TransactionScopeAsyncFlowOption asyncFlowOption);
new System.Transactions.TransactionScope : System.Transactions.TransactionScopeOption * System.Transactions.TransactionOptions * System.Transactions.TransactionScopeAsyncFlowOption -> System.Transactions.TransactionScope

參數

scopeOption
TransactionScopeOption

TransactionScopeOption 列舉的執行個體,會描述與此異動範圍有關聯的異動需求。An instance of the TransactionScopeOption enumeration that describes the transaction requirements associated with this transaction scope.

transactionOptions
TransactionOptions

TransactionOptions 結構,描述建立新異動時要使用的異動選項。A TransactionOptions structure that describes the transaction options to use if a new transaction is created. 如果使用現有的異動,則這個參數中的逾時值會套用至異動範圍。If an existing transaction is used, the timeout value in this parameter applies to the transaction scope. 如果該時間在處置範圍之前過期,則會中止異動。If that time expires before the scope is disposed, the transaction is aborted.

asyncFlowOption
TransactionScopeAsyncFlowOption

TransactionScopeAsyncFlowOption 列舉執行個體,這個執行個體描述異動範圍相關聯的環境異動是否會在使用 Task 或 async/await .NET 非同步程式設計模式時,跨執行緒接續流動。An instance of the TransactionScopeAsyncFlowOption enumeration that describes whether the ambient transaction associated with the transaction scope will flow across thread continuations when using Task or async/await .NET async programming patterns.

TransactionScope(Transaction, TimeSpan)

使用指定的逾時值,初始化 TransactionScope 類別的新執行個體,並將指定的異動設定為環境異動,以便在範圍內執行的異動式工作使用這個異動。Initializes a new instance of the TransactionScope class with the specified timeout value, and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

public:
 TransactionScope(System::Transactions::Transaction ^ transaction, TimeSpan timeout);
public TransactionScope (System.Transactions.Transaction transaction, TimeSpan timeout);
new System.Transactions.TransactionScope : System.Transactions.Transaction * TimeSpan -> System.Transactions.TransactionScope
Public Sub New (transactionToUse As Transaction, scopeTimeout As TimeSpan)

參數

transactionToUse
Transaction

要設定為環境異動的異動,以便在範圍內執行的異動式工作使用這個異動。The transaction to be set as the ambient transaction, so that transactional work done inside the scope uses this transaction.

scopeTimeout
TimeSpan

TimeSpan 之後,異動範圍將逾時而中止異動。The TimeSpan after which the transaction scope times out and aborts the transaction.

另請參閱

TransactionScope(TransactionScopeOption, TimeSpan)

使用指定的逾時值和需求,初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class with the specified timeout value and requirements.

public:
 TransactionScope(System::Transactions::TransactionScopeOption option, TimeSpan timeout);
public TransactionScope (System.Transactions.TransactionScopeOption option, TimeSpan timeout);
new System.Transactions.TransactionScope : System.Transactions.TransactionScopeOption * TimeSpan -> System.Transactions.TransactionScope
Public Sub New (option As TransactionScopeOption, timeout As TimeSpan)

參數

scopeOption
TransactionScopeOption

TransactionScopeOption 列舉的執行個體,會描述與此異動範圍有關聯的異動需求。An instance of the TransactionScopeOption enumeration that describes the transaction requirements associated with this transaction scope.

scopeTimeout
TimeSpan

TimeSpan 之後,異動範圍將逾時而中止異動。The TimeSpan after which the transaction scope times out and aborts the transaction.

另請參閱

TransactionScope(TransactionScopeOption, TransactionScopeAsyncFlowOption)

使用指定的需求和非同步流程選項,初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class with the specified requirements and asynchronous flow option.

public:
 TransactionScope(System::Transactions::TransactionScopeOption option, System::Transactions::TransactionScopeAsyncFlowOption asyncFlow);
public TransactionScope (System.Transactions.TransactionScopeOption option, System.Transactions.TransactionScopeAsyncFlowOption asyncFlow);
new System.Transactions.TransactionScope : System.Transactions.TransactionScopeOption * System.Transactions.TransactionScopeAsyncFlowOption -> System.Transactions.TransactionScope
Public Sub New (option As TransactionScopeOption, asyncFlow As TransactionScopeAsyncFlowOption)

參數

scopeOption
TransactionScopeOption

TransactionScopeOption 列舉的執行個體,會描述與此異動範圍有關聯的異動需求。An instance of the TransactionScopeOption enumeration that describes the transaction requirements associated with this transaction scope.

asyncFlowOption
TransactionScopeAsyncFlowOption

TransactionScopeAsyncFlowOption 列舉執行個體,這個執行個體描述異動範圍相關聯的環境異動是否會在使用 Task 或 async/await .NET 非同步程式設計模式時,跨執行緒接續流動。An instance of the TransactionScopeAsyncFlowOption enumeration that describes whether the ambient transaction associated with the transaction scope will flow across thread continuations when using Task or async/await .NET async programming patterns.

TransactionScope(TransactionScopeOption, TransactionOptions, EnterpriseServicesInteropOption)

使用指定的範圍和 COM+ 互通性需求,以及異動選項,初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class with the specified scope and COM+ interoperability requirements, and transaction options.

public:
 TransactionScope(System::Transactions::TransactionScopeOption scopeOption, System::Transactions::TransactionOptions options, System::Transactions::EnterpriseServicesInteropOption opt);
public TransactionScope (System.Transactions.TransactionScopeOption scopeOption, System.Transactions.TransactionOptions options, System.Transactions.EnterpriseServicesInteropOption opt);
new System.Transactions.TransactionScope : System.Transactions.TransactionScopeOption * System.Transactions.TransactionOptions * System.Transactions.EnterpriseServicesInteropOption -> System.Transactions.TransactionScope
Public Sub New (scopeOption As TransactionScopeOption, options As TransactionOptions, opt As EnterpriseServicesInteropOption)

參數

scopeOption
TransactionScopeOption

TransactionScopeOption 列舉的執行個體,會描述與此異動範圍有關聯的異動需求。An instance of the TransactionScopeOption enumeration that describes the transaction requirements associated with this transaction scope.

transactionOptions
TransactionOptions

TransactionOptions 結構,描述建立新異動時要使用的異動選項。A TransactionOptions structure that describes the transaction options to use if a new transaction is created. 如果使用現有的異動,則這個參數中的逾時值會套用至異動範圍。If an existing transaction is used, the timeout value in this parameter applies to the transaction scope. 如果該時間在處置範圍之前過期,則會中止異動。If that time expires before the scope is disposed, the transaction is aborted.

interopOption
EnterpriseServicesInteropOption

EnterpriseServicesInteropOption 列舉的執行個體,會描述關聯的異動如何與 COM+ 異動互動。An instance of the EnterpriseServicesInteropOption enumeration that describes how the associated transaction interacts with COM+ transactions.

備註

當您使用transactionOptions參數來IsolationLevel指定,而且範圍稍後會建立交易時,新的交易會與指定的隔離等級相關聯。When you use the transactionOptions parameter to specify an IsolationLevel, and the scope creates a transaction later, the new transaction is associated with the specified isolation level. 如果隔離等級與交易一起傳入,則交易必須具有相同的隔離等級,否則會擲回例外狀況。If an isolation level is passed in together with a transaction, the transaction must have an identical isolation level, or an exception is thrown.

注意這個方法會LinkDemand使用防止不受信任的程式碼呼叫它,不過,只有立即呼叫者才需要FullTrust擁有許可權集合。Note This method uses LinkDemand to prevent it from being called from untrusted code; however, only the immediate caller is required to possess the FullTrust permission set.

另請參閱

TransactionScope(Transaction, TimeSpan, EnterpriseServicesInteropOption)

使用指定的逾時值和 COM+ 互通性需求,初始化 TransactionScope 類別的新執行個體,並將指定的異動設定為環境異動,以便在範圍內執行的異動式工作使用這個異動。Initializes a new instance of the TransactionScope class with the specified timeout value and COM+ interoperability requirements, and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

public:
 TransactionScope(System::Transactions::Transaction ^ transaction, TimeSpan timeout, System::Transactions::EnterpriseServicesInteropOption opt);
public TransactionScope (System.Transactions.Transaction transaction, TimeSpan timeout, System.Transactions.EnterpriseServicesInteropOption opt);
new System.Transactions.TransactionScope : System.Transactions.Transaction * TimeSpan * System.Transactions.EnterpriseServicesInteropOption -> System.Transactions.TransactionScope
Public Sub New (transactionToUse As Transaction, scopeTimeout As TimeSpan, interopOption As EnterpriseServicesInteropOption)

參數

transactionToUse
Transaction

要設定為環境異動的異動,以便在範圍內執行的異動式工作使用這個異動。The transaction to be set as the ambient transaction, so that transactional work done inside the scope uses this transaction.

scopeTimeout
TimeSpan

TimeSpan 之後,異動範圍將逾時而中止異動。The TimeSpan after which the transaction scope times out and aborts the transaction.

interopOption
EnterpriseServicesInteropOption

EnterpriseServicesInteropOption 列舉的執行個體,會描述關聯的異動如何與 COM+ 異動互動。An instance of the EnterpriseServicesInteropOption enumeration that describes how the associated transaction interacts with COM+ transactions.

備註

注意這個方法會LinkDemand使用防止不受信任的程式碼呼叫它,不過,只有立即呼叫者才需要FullTrust擁有許可權集合。Note This method uses LinkDemand to prevent it from being called from untrusted code; however, only the immediate caller is required to possess the FullTrust permission set.

另請參閱

TransactionScope(TransactionScopeOption, TimeSpan, TransactionScopeAsyncFlowOption)

使用指定的逾時值、需求和非同步流程選項,初始化 TransactionScope 類別的新執行個體。Initializes a new instance of the TransactionScope class with the specified timeout value, requirements, and asynchronous flow option.

public:
 TransactionScope(System::Transactions::TransactionScopeOption option, TimeSpan timeout, System::Transactions::TransactionScopeAsyncFlowOption asyncFlow);
public TransactionScope (System.Transactions.TransactionScopeOption option, TimeSpan timeout, System.Transactions.TransactionScopeAsyncFlowOption asyncFlow);
new System.Transactions.TransactionScope : System.Transactions.TransactionScopeOption * TimeSpan * System.Transactions.TransactionScopeAsyncFlowOption -> System.Transactions.TransactionScope
Public Sub New (option As TransactionScopeOption, timeout As TimeSpan, asyncFlow As TransactionScopeAsyncFlowOption)

參數

scopeOption
TransactionScopeOption

TransactionScopeOption 列舉的執行個體,會描述與此異動範圍有關聯的異動需求。An instance of the TransactionScopeOption enumeration that describes the transaction requirements associated with this transaction scope.

scopeTimeout
TimeSpan

TimeSpan 之後,異動範圍將逾時而中止異動。The TimeSpan after which the transaction scope times out and aborts the transaction.

asyncFlowOption
TransactionScopeAsyncFlowOption

TransactionScopeAsyncFlowOption 列舉執行個體,這個執行個體描述異動範圍相關聯的環境異動是否會在使用 Task 或 async/await .NET 非同步程式設計模式時,跨執行緒接續流動。An instance of the TransactionScopeAsyncFlowOption enumeration that describes whether the ambient transaction associated with the transaction scope will flow across thread continuations when using Task or async/await .NET async programming patterns.

適用於