I created a small function for now that does what I want
public static void DTOToDataRow<T>(T from, DataRow row, IEnumerable<string> skipFields)
var props = ReflectionUtils
.Where(m => m.MemberType == MemberTypes.Field || m.MemberType == MemberTypes.Property && ((PropertyInfo)m).GetSetMethod() != null)
.Where(m => !skipFields.Select(sf => sf.ToUpper()).Contains(m.Name.ToUpper()));
foreach (PropertyInfo memberInfo in props)
row[memberInfo.Name] = memberInfo.GetValue(from, null) ?? DBNull.Value;
but I'd like to have this as a regular mapper :)
Please help me to write it.
The main issue I see in this function is that it doesn't cache the fields definition and collects them every time is called, that's slow, I'm hoping an official mapper is smart enough to cache this.