using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NCC.Common { public static class DataTableExtentions { /// /// DataTable 转List 集合 /// /// /// public static List> DataTableToDicList(this DataTable dt) { return dt.AsEnumerable().Select( row => dt.Columns.Cast().ToDictionary( column => column.ColumnName.ToLower(), column => row[column] )).ToList(); } } }