コード例 #1
0
        public void AddUnitOfWorkScope(string key, UnitOfWorkScope unit)
        {
            if (_unitOfWorkScopes.ContainsKey(key))
            {
                return;
            }

            _unitOfWorkScopes.Add(key, unit);
        }
コード例 #2
0
ファイル: UnitOfWork.cs プロジェクト: andriybilas/MasterM
        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);
        }
コード例 #3
0
ファイル: UnitOfWork.cs プロジェクト: andriybilas/MasterM
        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);
        }
コード例 #4
0
        public void AddUnitOfWorkScope(string key, UnitOfWorkScope unit)
        {
            if (_unitOfWorkScopes.ContainsKey(key)) return;

            _unitOfWorkScopes.Add(key, unit);
        }