Linq中的多条件查询扩展

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

      {         

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

     }

你可能感兴趣的:(LINQ)