Example #1
0
        /// <summary>
        /// Map a datareader to a new object of type T. If T implements IDictionary&lt;string,object&gt; then
        /// the dictionary will be populated.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="reader"></param>
        /// <returns></returns>
        public static T Map <T>(this IDataRecord record)
        {
            var wrapper = new DataRecordAdapter(record);

            return(wrapper.Map <T>());
        }
Example #2
0
        /// <summary>
        /// Map to a data record.
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="obj"></param>
        public static void Map(this IDataRecord record, object obj)
        {
            var wrapper = new DataRecordAdapter(record);

            wrapper.Map(obj);
        }