摘要:
public class ModelHelper <T> where T : new() { public static T ConvertModel(DataRow dr) { T t = new T(); Type modelType = t.GetType(); foreach (PropertyInfo p in modelType.GetProperties()) { p.SetValue(t, GetDefaultValue(dr[p.Name], p.PropertyType), null); } ... 阅读全文