Class ExpressionEqualityComparer
Customizable equality comparer for expression trees. Default behavior matches trees in a structural fashion.
Inheritance
System.Object
ExpressionEqualityComparer
Implements
System.Collections.Generic.IEqualityComparer<System.Linq.Expressions.Expression>
Namespace: System.Linq.CompilerServices
Assembly: Nuqleon.Linq.CompilerServices.dll
Syntax
public class ExpressionEqualityComparer : Object, IEqualityComparer<Expression>
Constructors
ExpressionEqualityComparer()
Creates a new expression equality comparer with structural matching behavior.
Declaration
public ExpressionEqualityComparer()
ExpressionEqualityComparer(Func<ExpressionEqualityComparator>)
Creates a new expression equality comparer with custom matching behavior implemented on the specified comparator.
Declaration
public ExpressionEqualityComparer(Func<ExpressionEqualityComparator> comparatorFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<ExpressionEqualityComparator> | comparatorFactory | Factory for comparators that define custom matching behavior. |
Methods
Equals(Expression, Expression)
Checks whether the two given expressions are equal.
Declaration
public bool Equals(Expression x, Expression y)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression | x | First expression. |
System.Linq.Expressions.Expression | y | Second expression. |
Returns
Type | Description |
---|---|
System.Boolean | true if both expressions are equal; otherwise, false. |
GetHashCode(Expression)
Gets a hash code for the given expression.
Declaration
public int GetHashCode(Expression obj)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression | obj | Expression to compute a hash code for. |
Returns
Type | Description |
---|---|
System.Int32 | Hash code for the given expression. |
Implements
System.Collections.Generic.IEqualityComparer<>