private Expression FindSimilarRight(JoinExpression join, JoinExpression compareTo)
        {
            if (join == null)
            {
                return(null);
            }
            if ((join.Join == compareTo.Join) && ((join.Right.NodeType == compareTo.Right.NodeType) && DbExpressionComparer.AreEqual(join.Right, compareTo.Right)))
            {
                if (join.Condition == compareTo.Condition)
                {
                    return(join.Right);
                }
                ScopedDictionary <TableAlias, TableAlias> aliasScope = new ScopedDictionary <TableAlias, TableAlias>(null);
                aliasScope.Add(((AliasedExpression)join.Right).Alias, ((AliasedExpression)compareTo.Right).Alias);
                if (DbExpressionComparer.AreEqual(null, aliasScope, join.Condition, compareTo.Condition))
                {
                    return(join.Right);
                }
            }
            Expression expression = this.FindSimilarRight(join.Left as JoinExpression, compareTo);

            if (expression == null)
            {
                expression = this.FindSimilarRight(join.Right as JoinExpression, compareTo);
            }
            return(expression);
        }
Esempio n. 2
0
 public bool Equals(Parameterizer.HashedExpression other)
 {
     return((this.hashCode == other.hashCode) && DbExpressionComparer.AreEqual(this.expression, other.expression));
 }