Exemplo n.º 1
0
        public ITokenConsumeScope BeginScope()
        {
            if (_currentScope != null)
            {
                throw new NestedTransactionScopeExistsException();
            }

            var scope = new TokenConsumeScope(this);
            _currentScope = scope;
            return scope;
        }
Exemplo n.º 2
0
        public ITokenConsumeScope Begin()
        {
            if (_nestedTransaction != null)
            {
                if (_nestedTransaction._consumedCache.Count != 0)
                {
                    throw new NestedTransactionScopeExistsException();
                }
                else
                {
                    return _nestedTransaction;
                }
            }

            return _nestedTransaction = new TokenConsumeScope(this);
        }