把包含 对象 数据的DataRow转换成 实体对象(泛型反射方式)
public static T Row2Model<T>(DataRow dr) where T : new() { T model = new T(); foreach (PropertyInfo p in (typeof(T)).GetProperties()) { if (dr[p.Name] is System.DBNull) { break; } p.SetValue(model, dr[p.Name], null); } return model; }