コード例 #1
0
ファイル: UnitOfWorkScope.cs プロジェクト: zlobur/ncommon
 /// <summary>
 /// Overloaded Constructor.
 /// Creates a new instance of <see cref="UnitOfWorkScope"/> with the specified transaction isolation level, option connection and
 /// a transaction option that specifies if an existing transaction should be used or to create a new transaction.
 /// </summary>
 /// <param name="isolationLevel"></param>
 /// <param name="transactionOptions"></param>
 public UnitOfWorkScope(IsolationLevel isolationLevel, UnitOfWorkScopeTransactionOptions transactionOptions)
 {
     _disposed     = false;
     _autoComplete = (transactionOptions & UnitOfWorkScopeTransactionOptions.AutoComplete) ==
                     UnitOfWorkScopeTransactionOptions.AutoComplete;
     _currentTransaction = UnitOfWorkScopeTransaction.GetTransactionForScope(this, isolationLevel,
                                                                             transactionOptions);
     RegisterScope(this);
 }