AreEqual() public static method

public static AreEqual ( Expression a, Expression b ) : bool
a System.Linq.Expressions.Expression
b System.Linq.Expressions.Expression
return bool
Esempio n. 1
0
        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, TableAlias.Comparer);
                    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);
        }
Esempio n. 2
0
 public bool Equals(HashedExpression other)
 {
     return(this.hashCode == other.hashCode &&
            DbExpressionComparer.AreEqual(this.expression, other.expression));
 }