Class SemanticComparer<TSource, TDestination>
Provides a class with implementations of the System.Collections.Generic.IEqualityComparer{T} and System.Collections.Generic.IEqualityComparer interfaces for convention-based object equality comparison for use when comparing two semantically equivalent, but different, objects.
Inheritance
Implements
Inherited Members
Namespace: SemanticComparison
Assembly: SemanticComparison.dll
Syntax
public class SemanticComparer<TSource, TDestination> : IEqualityComparer, IEqualityComparer<object>
Type Parameters
Name | Description |
---|---|
TSource | The type of the source value (against which the destination value will be compared for equality). |
TDestination | The type of the destination value which will be compared for equality against the source value. |
Constructors
| Improve this Doc View SourceSemanticComparer()
Initializes a new instance of the SemanticComparer<TSource, TDestination> class.
Declaration
public SemanticComparer()
Methods
| Improve this Doc View SourceEquals(Object, Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public bool Equals(object x, object y)
Parameters
Type | Name | Description |
---|---|---|
System.Object | x | The source value (against which the destination value will be compared for equality). |
System.Object | y | The destination value which will be compared for equality against the source value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetHashCode(Object)
Returns a hash code for this instance.
Declaration
public int GetHashCode(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The obj. |
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The type of |
Explicit Interface Implementations
| Improve this Doc View SourceIEqualityComparer.Equals(Object, Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
bool IEqualityComparer.Equals(object x, object y)
Parameters
Type | Name | Description |
---|---|---|
System.Object | x | The source value (against which the destination value will be compared for equality). |
System.Object | y | The destination value which will be compared for equality against the source value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
IEqualityComparer.GetHashCode(Object)
Returns a hash code for this instance.
Declaration
int IEqualityComparer.GetHashCode(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The obj. |
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The type of |