public static Expression And(Expression left, Expression right) => new BinaryExpression(left, ExpressionKind.And, right);
public static Expression Or(Expression left, Expression right) => new BinaryExpression(left, ExpressionKind.Or, right);
public BinaryExpression(Expression left, ExpressionKind op, Expression right) { Left = left; Right = right; Op = op; }
public static Expression Not(Expression value) => new UnaryExpression(ExpressionKind.Not, value);
public OrderByExpression(Expression memberExpression, SortDirection direction) { MemberExpression = memberExpression; Direction = direction; }
public InExpression(Expression propertyName, params Expression[] values) { PropertyName = propertyName; Values = values; }
public BetweenExpression(Expression property, Constant start, Constant end) { Property = property; Start = start; End = end; }
public UnaryExpression(ExpressionKind op, Expression operand) { Operand = operand; Op = op; }
private static BinaryExpression Chain(Expression left, IEnumerator<Expression> e, ExpressionKind op) { var right = e.Current; return new BinaryExpression( left : left, op : op, right : e.MoveNext() ? Chain(right, e, op) : right); }