System.Linq.Expressions.Expression.And C# (CSharp) Method

And() public static method

Creates a BinaryExpression that represents an bitwise AND operation.
public static And ( Expression left, Expression right ) : BinaryExpression
left Expression An to set the property equal to.
right Expression An to set the property equal to.
return BinaryExpression
        public static BinaryExpression And(Expression left, Expression right)
        {
            return And(left, right, method: null);
        }

Same methods

Expression::And ( Expression left, Expression right, MethodInfo method ) : BinaryExpression

Usage Example

 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;
         }
     }
 }
All Usage Examples Of System.Linq.Expressions.Expression::And
Expression