using System; using System.Collections.Generic; using System.Diagnostics; namespace Znyc.Recruitment.Admin.Commons.Extend { /// /// IEnumerable��չ�� /// [DebuggerStepThrough] public static class ExtIEnumerable { /// /// ѭ��IEnumerable /// /// /// /// /// public static IEnumerable Each(this IEnumerable source, Action fun) { foreach (T item in source) { fun(item); } return source; } /// /// IEnumerableתList /// /// /// /// /// /// public static List ToList(this IEnumerable source, Func fun) { List result = new List(); source.Each(m => result.Add(fun(m))); return result; } } }