2010-07-18 109 views

回答

8

存在方式(從TransactionScope MSDN文檔直接複製):

環境交易是 您的代碼執行英寸您 可以通過調用靜態 交易 類的當前屬性獲得環境 交易的參考。

所以看看交易。 Current

3

您可以檢查Transaction.Current屬性:

if(Transaction.Current != null) 
{ 
    // running inside a transaction 
} 
相關問題