Ejemplo n.º 1
0
 public TResult Get <TResult>(string sql) where TResult : new()
 {
     using (IDbConnection conn = DbConnectFactory.GetPostgresqlConnection())
     {
         conn.Open();
         conn.BeginTransaction();
         IDataReader reader = conn.ExecuteReader(sql);
         DataTable   table  = reader.GetSchemaTable();
         return(DataConvertExtension <TResult> .Get(table));
     }
 }
 public T Get(string sql)
 {
     using (IDbConnection conn = ConnectionFactory.CreateConnection())
     {
         conn.Open();
         conn.BeginTransaction();
         IDataReader reader = conn.ExecuteReader(sql);
         DataTable   table  = reader.GetSchemaTable();
         return(DataConvertExtension <T> .Get(table));
     }
 }