Ejemplo n.º 1
0
        public PocoEnumerator(DbDataReader reader)
        {
            _reader = reader;
            _open   = true;

            _pocoMapper = new PocoMapper <T>(reader);
        }
        public PocoCachedEnumerator(DbDataReader reader)
        {
            _reader    = reader;
            _rowNumber = -1;
            _maxRow    = -1;
            _open      = true;

            _pocoMapper = new PocoMapper <T>(reader);
            _data       = new List <T>();
        }
Ejemplo n.º 3
0
        public async Task <List <T> > ToListAsync(DbDataReader reader, CancellationToken cancellationToken)
        {
            var pocoMapping = new PocoMapper <T>(reader);
            var data        = new List <T>();

            while (await reader.ReadAsync(cancellationToken))
            {
                data.Add(pocoMapping.GetItem());
            }

            return(data);
        }
Ejemplo n.º 4
0
        public async Task <List <T> > ToListAsync(DbDataReader reader, long rows, CancellationToken cancellationToken)
        {
            var pocoMapping = new PocoMapper <T>(reader);
            var data        = new List <T>();

            var row = 0;

            while (await reader.ReadAsync(cancellationToken) && (rows > row || rows < 0))
            {
                data.Add(pocoMapping.GetItem());
                row++;
            }

            return(data);
        }