摘要: 说的是C#如何体贴程序员,而非.NET Framework。如果打算写一个类似System.Linq.Enumerable.Where的extention method,假设命名为Filter,下面是C#为满足此需求下的功夫: public static IEnumerable<T> Filter<T>(this IEnumerable<T> source, Func<T, bool> predicate) { if (source == null || predicate == null) { throw new ArgumentNullExc 阅读全文
posted @ 2011-10-26 08:04 James Leng 阅读(1067) 评论(3) 推荐(0) 编辑