Linq中的多条件查询扩展

  public static IQueryable<T> WHEREIF<T>(this IQueryable<T> source, Expression<Func<T, bool>> filter, bool isEmpty)   

      {         

                return isEmpty ? source.Where(filter) : source;    

     }

posted @ 2012-03-19 11:03  kevinzw  阅读(333)  评论(0编辑  收藏  举报