Casting PgSqlDataReader to List<T>

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
JORGEMAL
Posts: 171
Joined: Thu 03 Jul 2008 23:55

Casting PgSqlDataReader to List<T>

Post by JORGEMAL » Fri 27 Oct 2017 01:53

I am planning to migrate a web forms project to MVC. In web forms I usually save the result of a SELECT statement in a PgSqlDataReader. What I want is to "cast" PgSqlDataReader to List<T>. One way to do it is to iterate the reader and add items to the list. Is there a "direct" way to perform such a casting?

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Casting PgSqlDataReader to List<T>

Post by Pinturiccio » Mon 30 Oct 2017 14:34

dotConect for PostgreSQL does not support such a feature. You need to implement it yourself. The following link can be useful for you: https://stackoverflow.com/questions/1464883/

Post Reply