Beispiel #1
0
        internal List <TBean> SelectAll(IDbConnection conn)
        {
            IDataReader  dr   = DbProviderFactory.CreateDataReader(conn, CreateSelectAllCommand(), Provider);
            List <TBean> list = MapObjects(dr);

            dr.Close();
            return(list);
        }
Beispiel #2
0
        internal TBean SelectById(TId id, IDbConnection connection)
        {
            TBean       o  = default(TBean);
            IDataReader dr = DbProviderFactory.CreateDataReader(connection, CreateSelectOneCommand(id), Provider);

            while (dr.Read())
            {
                o = MapObject(dr);
                break;
            }
            dr.Close();

            return(o);
        }