Page 1 of 1

Casting PgSqlDataReader to List<T>

Posted: Fri 27 Oct 2017 01:53
by JORGEMAL
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?

Re: Casting PgSqlDataReader to List<T>

Posted: Mon 30 Oct 2017 14:34
by Pinturiccio
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/