|
|
@ -34,12 +34,7 @@ namespace System.Linq |
|
|
|
|
|
|
|
|
protected override Expression VisitParameter(ParameterExpression node) |
|
|
protected override Expression VisitParameter(ParameterExpression node) |
|
|
{ |
|
|
{ |
|
|
if (node == _oldParameter) |
|
|
return node == _oldParameter ? _newParameter : base.VisitParameter(node); |
|
|
{ |
|
|
|
|
|
return _newParameter; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return base.VisitParameter(node); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -55,20 +50,6 @@ namespace System.Linq |
|
|
return new ExpressionStarter<T>(defaultExpression); |
|
|
return new ExpressionStarter<T>(defaultExpression); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// <summary> Always true </summary>
|
|
|
|
|
|
[Obsolete("Use PredicateBuilder.New() instead.")] |
|
|
|
|
|
public static Expression<Func<T, bool>> True<T>() |
|
|
|
|
|
{ |
|
|
|
|
|
return new ExpressionStarter<T>(true); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> Always false </summary>
|
|
|
|
|
|
[Obsolete("Use PredicateBuilder.New() instead.")] |
|
|
|
|
|
public static Expression<Func<T, bool>> False<T>() |
|
|
|
|
|
{ |
|
|
|
|
|
return new ExpressionStarter<T>(false); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> OR </summary>
|
|
|
/// <summary> OR </summary>
|
|
|
public static Expression<Func<T, bool>> Or<T>([NotNull] this Expression<Func<T, bool>> expr1, |
|
|
public static Expression<Func<T, bool>> Or<T>([NotNull] this Expression<Func<T, bool>> expr1, |
|
|
[NotNull] Expression<Func<T, bool>> expr2) |
|
|
[NotNull] Expression<Func<T, bool>> expr2) |
|
|
@ -127,9 +108,13 @@ namespace System.Linq |
|
|
public ExpressionStarter(bool defaultExpression) |
|
|
public ExpressionStarter(bool defaultExpression) |
|
|
{ |
|
|
{ |
|
|
if (defaultExpression) |
|
|
if (defaultExpression) |
|
|
|
|
|
{ |
|
|
DefaultExpression = f => true; |
|
|
DefaultExpression = f => true; |
|
|
|
|
|
} |
|
|
else |
|
|
else |
|
|
|
|
|
{ |
|
|
DefaultExpression = f => false; |
|
|
DefaultExpression = f => false; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public ExpressionStarter(Expression<Func<T, bool>> exp) : this(false) |
|
|
public ExpressionStarter(Expression<Func<T, bool>> exp) : this(false) |
|
|
|