private Expression FindSimilarRight(DbJoinExpression join, DbJoinExpression 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 <DbTableAlias, DbTableAlias>(null); scope.Add(((DbAliasedExpression)join.Right).Alias, ((DbAliasedExpression)compareTo.Right).Alias); if (DbExpressionComparer.AreEqual(null, scope, join.Condition, compareTo.Condition)) { return(join.Right); } } } Expression result = FindSimilarRight(join.Left as DbJoinExpression, compareTo); if (result == null) { result = FindSimilarRight(join.Right as DbJoinExpression, compareTo); } return(result); }
public bool Equals(HashedExpression other) { return(this.hashCode == other.hashCode && DbExpressionComparer.AreEqual(this.expression, other.expression)); }