1 /// <summary> 2 /// WhereIF扩展 3 /// </summary> 4 /// <typeparam name="TSource"></typeparam> 5 /// <param name="source"></param> 6 /// <param name="where"></param> 7 /// <param name="predicate"></param> 8 /// <returns></returns> 9 public static IEnumerable<TSource> WhereIF<TSource>(this IEnumerable<TSource> source,bool where , Func<TSource, bool> predicate) 10 { 11 if (where) 12 return source.Where(predicate); 13 14 return source; 15 }
标签:predicate,IEnumerable,return,WhereIF,List,扩展,source,where From: https://www.cnblogs.com/g-w-j/p/16647378.html