Using Dapper.net can I get the schema for the query I am issuing?

dapper

Question

i.e. if the query returns 0 rows, I still would like to know the list of columns returned.

Expert Answer

There is a method that returns an IDataReader - possibly ExecuteReader or similar - that tells you everything you want to know about the schema. However, with dapper it would be largely expected that you know what the schema looks like ahead of time.



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why