Exemplo n.º 1
0
        /// <summary>
        /// get all rows from one result from reader
        /// </summary>
        /// <param name="reader">data reader</param>
        /// <returns>return list of rows</returns>
        /// <remarks>this method is optimized for single result set</remarks>
        public static IList <T> ReadSingleResultset(IDataReader reader)
        {
            var list = new List <T>();

            string[] columns = DataMap.GetColumns(reader);

            DataMap.ReadSingleResultset(reader, columns, list, metaData);

            return(list);
        }
Exemplo n.º 2
0
        /// <summary>
        /// read current object from data reader
        /// </summary>
        /// <param name="reader">data reader</param>
        /// <returns>return object from data reader</returns>
        public static T ReadCurrentRow(IDataReader reader)
        {
            T instance = CreateConcrete();

            string[] columns = DataMap.GetColumns(reader);

            DataMap.ReadCurrentRow(reader, columns, instance, metaData);

            return(instance);
        }