Exemple #1
0
        private async Task <bool> ReadImpl(AsyncWrappingCommonArgs async)
        {
            CheckState();

            var retValue = false;

            if (IsCommandBehavior(CommandBehavior.SingleRow) && _position != StartPosition)
            {
            }
            else
            {
                if (IsCommandBehavior(CommandBehavior.SchemaOnly))
                {
                }
                else
                {
                    _row = await _command.Fetch(async).ConfigureAwait(false);

                    if (_row != null)
                    {
                        _position++;
                        retValue = true;
                    }
                    else
                    {
                        _eof = true;
                    }
                }
            }

            return(retValue);
        }
Exemple #2
0
        public override bool Read()
        {
            CheckState();

            var retValue = false;

            if (IsCommandBehavior(CommandBehavior.SingleRow) && _position != StartPosition)
            {
            }
            else
            {
                if (IsCommandBehavior(CommandBehavior.SchemaOnly))
                {
                }
                else
                {
                    _row = _command.Fetch();

                    if (_row != null)
                    {
                        _position++;
                        retValue = true;
                    }
                    else
                    {
                        _eof = true;
                    }
                }
            }

            return(retValue);
        }
Exemple #3
0
        public override bool Read()
        {
            CheckState();

            if (IsCommandBehavior(CommandBehavior.SchemaOnly))
            {
                return(false);
            }
            else if (IsCommandBehavior(CommandBehavior.SingleRow) && _position != StartPosition)
            {
                return(false);
            }
            else
            {
                using (var explicitCancellation = ExplicitCancellation.Enter(CancellationToken.None, _command.Cancel))
                {
                    _row = _command.Fetch();
                    if (_row != null)
                    {
                        _position++;
                        return(true);
                    }
                    else
                    {
                        _eof = true;
                        return(false);
                    }
                }
            }
        }