代码改变世界

随笔档案-2012年8月31日

C#中Lambda表达式的使用

2012-08-31 16:43 by C#与.NET探索者, 823 阅读, 收藏,
摘要: //where T : class , new() :说明泛型T是一个类,并且能在方法中实例化这个类。public static List<T> ToList<T>(this DataTable dt) where T : class, new(){List<T> list;T model;List<PropertyInfo> infos;object tempValue; list = new List<T>(); infos = new List<PropertyInfo>(); Array.ForEach<Pr 阅读全文