CreateTransactionScopeAsync(
            string memberName     = "",
            string sourceFilePath = "",
            int sourceLineNumber  = 0)
        {
            if (_dbConnection.State != ConnectionState.Open)
            {
                await((DbConnection)_dbConnection).OpenAsync();
            }

            _dbTransaction ??= ((DbConnection)_dbConnection).BeginTransaction(IsolationLevel);

            if (_dbContext == null && _dbContextFactory != null)
            {
                _dbContext = _dbContextFactory.Invoke(_dbConnection, _dbTransaction);
            }

            var ts =
                OneWorldDbTransactionScope <TDbContext> .Create(
                    _dbConnection,
                    _dbTransaction,
                    _dbContext,
                    this,
                    _logger,
                    memberName,
                    sourceFilePath,
                    sourceLineNumber);

            ++_activeChildren;
            ++_totalChildren;

            _answers.TryAdd(ts, null);

            return(ts);
        }
        public VotingResult RollbackPlease(OneWorldDbTransactionScope <TDbContext> ts)
        {
            if (!_answers.TryUpdate(ts, false, null))
            {
                return(VotingResult.AlreadyVoted);
            }

            ++_beRollbacks;
            return(VotingResult.VoteComplete);
        }
        public VotingResult CommitPlease(OneWorldDbTransactionScope <TDbContext> ts)
        {
            if (!_answers.TryUpdate(ts, true, null))
            {
                return(VotingResult.AlreadyVoted);
            }

            ++_beCommits;
            return(VotingResult.VoteComplete);
        }