public override bool Equals(object obj) { if (!(obj is BinaryExpr)) { return(false); } BinaryExpr other = (BinaryExpr)obj; return(Expr1.Equals(other.Expr1) && Expr2.Equals(other.Expr2)); }
public override Expr Simplify() { if (Expr1.Equals(new CstI(0)) && Expr2.Equals(new CstI(0))) { return(new CstI(0)); } if (Expr1.Equals(Expr2)) { return(new CstI(0)); } return(Expr2.Equals(new CstI(0)) ? Expr1 : this); }
public bool Equals(ISqlExpression?other, Func <ISqlExpression, ISqlExpression, bool> comparer) { if (this == other) { return(true); } return (other is SqlBinaryExpression expr && Operation == expr.Operation && SystemType == expr.SystemType && Expr1.Equals(expr.Expr1, comparer) && Expr2.Equals(expr.Expr2, comparer) && comparer(this, other)); }
bool IEquatable <ISqlExpression> .Equals(ISqlExpression other) { if (this == other) { return(true); } var expr = other as SqlBinaryExpression; return (expr != null && Operation == expr.Operation && SystemType == expr.SystemType && Expr1.Equals(expr.Expr1) && Expr2.Equals(expr.Expr2)); }
public bool Equals(IQueryExpression other, Func <IQueryExpression, IQueryExpression, bool> comparer) { if (this == other) { return(true); } var expr = other as ISqlBinaryExpression; return (expr != null && Operation == expr.Operation && SystemType == expr.SystemType && Expr1.Equals(expr.Expr1, comparer) && Expr2.Equals(expr.Expr2, comparer) && comparer(this, other)); }