Class MemberInfoEqualityComparer

Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll

Provides custom equality comparison for MemberInfo instances.

public class MemberInfoEqualityComparer : IEqualityComparer<MemberInfo>, IEqualityComparer

Inheritance

objectMemberInfoEqualityComparer

Implements

IEqualityComparer<MemberInfo>, IEqualityComparer

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

MemberInfoEqualityComparer()

public MemberInfoEqualityComparer()

Methods

Equals(MemberInfo, MemberInfo)

Determines whether the specified objects are equal.

public bool Equals(MemberInfo x, MemberInfo y)

Parameters

x MemberInfo

The first MemberInfo instance to compare.

y MemberInfo

The second MemberInfo instance to compare.

Returns

bool

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

Remarks

x and y are considered equal if x is exactly equal to y. If not, they are still considered equal if both instances' `DeclaringType` and `Name` properties are equal.

GetHashCode(MemberInfo)

Returns a hash code for a MemberInfo instance.

public int GetHashCode(MemberInfo obj)

Parameters

obj MemberInfo

The object.

Returns

int

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

Exceptions

ArgumentNullException

The type of obj is a reference type and obj is null.