private Expression FindSimilarRight(JoinExpression join, JoinExpression compareTo) { if (join == null) { return(null); } if (join.Join == compareTo.Join) { if (join.Right.NodeType == compareTo.Right.NodeType && DbExpressionComparer.AreEqual(join.Right, compareTo.Right)) { if (join.Condition == compareTo.Condition) { return(join.Right); } var scope = new ScopedDictionary <TableAlias, TableAlias>(null); scope.Add(((AliasedExpression)join.Right).Alias, ((AliasedExpression)compareTo.Right).Alias); if (DbExpressionComparer.AreEqual(null, scope, join.Condition, compareTo.Condition)) { return(join.Right); } } } Expression result = FindSimilarRight(join.Left as JoinExpression, compareTo); if (result == null) { result = FindSimilarRight(join.Right as JoinExpression, compareTo); } return(result); }
public bool Equals(HashedExpression other) { return(this.hashCode == other.hashCode && DbExpressionComparer.AreEqual(this.expression, other.expression)); }