public void AddUnitOfWorkScope(string key, UnitOfWorkScope unit) { if (_unitOfWorkScopes.ContainsKey(key)) { return; } _unitOfWorkScopes.Add(key, unit); }
public UnitOfWork(UnitOfWorkScopeType scopeType) { _preCommitActions = new List<Action>(); switch (scopeType) { case UnitOfWorkScopeType.New: _transactionScope = new TransactionScope(TransactionScopeOption.RequiresNew); _unitOfWorkScope = new UnitOfWorkScope(scopeType); break; default: _transactionScope = new TransactionScope(TransactionScopeOption.RequiresNew); _unitOfWorkScope = UnitOfWorkManager.Instance.CurrentUnitOfWorkScope ?? new UnitOfWorkScope(scopeType); break; } _unitOfWorkScope.Units.Add(this); }
public UnitOfWork(UnitOfWorkScopeType scopeType) { _preCommitActions = new List <Action>(); switch (scopeType) { case UnitOfWorkScopeType.New: _transactionScope = new TransactionScope(TransactionScopeOption.RequiresNew); _unitOfWorkScope = new UnitOfWorkScope(scopeType); break; default: _transactionScope = new TransactionScope(TransactionScopeOption.RequiresNew); _unitOfWorkScope = UnitOfWorkManager.Instance.CurrentUnitOfWorkScope ?? new UnitOfWorkScope(scopeType); break; } _unitOfWorkScope.Units.Add(this); }
public void AddUnitOfWorkScope(string key, UnitOfWorkScope unit) { if (_unitOfWorkScopes.ContainsKey(key)) return; _unitOfWorkScopes.Add(key, unit); }