コード例 #1
0
        protected virtual IList <T> LoadResults(string commandText)
        {
            var conn = _sess.Connection();
            var cmd  = conn.CreateCommand();

            cmd.CommandText = commandText;

            var retList = new List <T>();

            using (var rdr = cmd.ExecuteReader())
            {
                while (rdr.Read() && !rdr.IsClosed)
                {
                    var rec = LoadFromReader(rdr);
                    retList.Add(rec);
                }

                rdr.Close();
            }
            return(retList);
        }