/// <summary> /// Map a datareader to a new object of type T. If T implements IDictionary<string,object> 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>()); }
/// <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); }