Linq中的多条件查询扩展

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

      {         

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

     }

原文地址:https://www.cnblogs.com/a546558309/p/2405764.html