Transaction.Current 屬性

定義

取得或設定環境交易。

public:
 static property System::Transactions::Transaction ^ Current { System::Transactions::Transaction ^ get(); void set(System::Transactions::Transaction ^ value); };
public static System.Transactions.Transaction? Current { get; set; }
public static System.Transactions.Transaction Current { get; set; }
member this.Current : System.Transactions.Transaction with get, set
Public Shared Property Current As Transaction

屬性值

Transaction

Transaction,說明目前交易。

備註

For more information on ambient transactions, please see the "Managing transaction flow using TransactionScopeOption" section of the Implementing an Implicit Transaction using Transaction Scope topic.

雖然您可以使用這個屬性來設定環境交易,但您應該盡可能使用 TransactionScope 物件來操作環境交易。

此屬性為執行緒靜態。 如果您在 呼叫 時 Dispose ,會擲回 使用 中的 TransactionScope InvalidOperationException 這個屬性變更環境交易,並還原先前的環境交易值。

適用於