标签:static this ble ESS nbsp cond express query his
1 条件判断是否要加过滤条件
public static IQueryable<T> WhereIf<T>(
this IQueryable<T> source,
Expression<Func<T, bool>> predicate,
bool condition)
{
source.CheckNotNull<IQueryable<T>>(nameof (source));
predicate.CheckNotNull<Expression<Func<T, bool>>>(nameof (predicate));
return condition ? source.Where<T>(predicate) : source;
}
标签:static this ble ESS nbsp cond express query his
原文地址:https://www.cnblogs.com/xiewenyu/p/10688708.html