EqualityComparerBase<T>

Namespace: Proffer

Implements IEqualityComparer<T> by comparing individual equality components from child class.

public abstract class EqualityComparerBase<T> : , System.Collections.IEqualityComparer, 

Type Parameters

T
The type of objects to compare.

Inheritance Object → EqualityComparer<T> → EqualityComparerBase<T>
Implements IEqualityComparer, IEqualityComparer<T>

Methods

Equals(T, T)

When overridden in a derived class, determines whether two objects of type T are equal.

public bool Equals(T x, T y)

Parameters

x T
The first object to compare.

y T
The second object to compare.

Returns

Boolean

        true if the specified objects are equal; otherwise, false.

GetHashCode(T)

Returns a hash code for this instance.

public int GetHashCode(T obj)

Parameters

obj T
The object.

Returns

Int32

        A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

GetEqualityComponents(T)

Gets the object’s components that participate in equality comparisons.

protected abstract IEnumerable<object> GetEqualityComponents(T obj)

Parameters

obj T
The object.

Returns

IEnumerable<Object>
An enumerable containing the properties values.