public static And ( |
||
left | An |
|
right | An |
|
method | A |
|
Résultat |
public static BinaryExpression And(Expression left, Expression right, MethodInfo method)
{
RequiresCanRead(left, nameof(left));
RequiresCanRead(right, nameof(right));
if (method == null)
{
if (left.Type == right.Type && left.Type.IsIntegerOrBool())
{
return new SimpleBinaryExpression(ExpressionType.And, left, right, left.Type);
}
return GetUserDefinedBinaryOperatorOrThrow(ExpressionType.And, "op_BitwiseAnd", left, right, liftToNull: true);
}
return GetMethodBasedBinaryOperator(ExpressionType.And, left, right, method, liftToNull: true);
}
Expression::And ( |
public override Expression<Func<Unbrickable.Models.Post, bool>> filterPosts(Expression<Func<Unbrickable.Models.Post, bool>> predicate) { if (operation != 1 && operation != 2 && operation != 3) { return predicate; } if (this.isOr) { Debug.WriteLine("Or " + this.operation + " on " + this.date.Date); switch (operation) { case 1: return predicate.Or(x => DbFunctions.TruncateTime(x.date_posted) >= this.date); case 2: return predicate.Or(x => DbFunctions.TruncateTime(x.date_posted) <= this.date); case 3: return predicate.Or(x => DbFunctions.TruncateTime(x.date_posted) == this.date); default: return predicate; } } else { Debug.WriteLine("And " + this.operation + " on " + this.date.Date); switch (operation) { case 1: return predicate.And(x => DbFunctions.TruncateTime(x.date_posted) >= this.date); case 2: return predicate.And(x => DbFunctions.TruncateTime(x.date_posted) <= this.date); case 3: return predicate.And(x => DbFunctions.TruncateTime(x.date_posted) == this.date); default: return predicate; } } }