private static List<T> TableToEntity<T>(DataTable dt) where T : class,new()
{
Type type = typeof(T);
List<T> list = new List<T>();
foreach (DataRow row in )
{
PropertyInfo[] pArray = ();
T entity = new T();
foreach (PropertyInfo p in pArray)
{
if (row[] is Int64)
{
(entity, Convert.ToInt32(row[]), null);
continue;
}
(entity, row[], null);
}
(entity);
}
return list;
}
// Call:
List<User> userList = TableToEntity<User>(YourDataTable);