TransactionScope() public static method

지정된 Action 들을 하나의 Transaction Scope로 묶어서 처리합니다.
public static TransactionScope ( ) : void
return void
Esempio n. 1
0
 public void UseTransactionScopeTest()
 {
     AdoWith.TransactionScope(TransactionScopeOption.Required,
                              System.Transactions.IsolationLevel.ReadCommitted,
                              SetParameterValuesGeneric,
                              MethodInTransaction);
 }
 public void TransactionScope_ShouldNotPromoteToDTC3()
 {
     TestTool.RunTasks(10,
                       () => AdoWith.TransactionScope(TransactionScopeOption.Required,
                                                      System.Transactions.IsolationLevel.ReadCommitted,
                                                      delegate { var count = TotalCount(); },
                                                      delegate {
         NorthwindAdoRepository.ExecuteNonQueryBySqlString(SQL_REGION_INSERT);
         NorthwindAdoRepository.ExecuteNonQueryBySqlString(SQL_REGION_INSERT2);
         NorthwindAdoRepository.ExecuteNonQueryBySqlString(SQL_REGION_DELETE);
     },
                                                      delegate {
         var ds =
             NorthwindAdoRepository.ExecuteDataSetBySqlString(
                 SQL_REGION_SELECT, 1, 10);
     },
                                                      delegate {
         var dt =
             NorthwindAdoRepository.ExecuteDataTableBySqlString(
                 SQL_REGION_SELECT, 1, 10);
     }
                                                      ));
 }