Table of Contents

Class IEqualityComparerExtensions

Namespace
NextORM.Core
Assembly
nextorm.core.dll

Extension methods that compare collections element-wise with an IEqualityComparer<T> or IValueEqualityComparer<T>.

public static class IEqualityComparerExtensions
Inheritance
IEqualityComparerExtensions
Inherited Members

Methods

Equals<T>(IEqualityComparer<T>, IReadOnlyList<T>?, IReadOnlyList<T>?)

Determines whether two lists contain the same elements, using the comparer.

public static bool Equals<T>(this IEqualityComparer<T> comparer, IReadOnlyList<T>? x, IReadOnlyList<T>? y)

Parameters

comparer IEqualityComparer<T>

The element comparer.

x IReadOnlyList<T>

The first list, or null.

y IReadOnlyList<T>

The second list, or null.

Returns

bool

true when both are null, or both have equal count and equal elements.

Type Parameters

T

The element type.

Equals<T>(IEqualityComparer<T>, T[]?, T[]?)

Determines whether two arrays contain the same elements, using the comparer.

public static bool Equals<T>(this IEqualityComparer<T> comparer, T[]? x, T[]? y) where T : class

Parameters

comparer IEqualityComparer<T>

The element comparer.

x T[]

The first array, or null.

y T[]

The second array, or null.

Returns

bool

true when both are null, or both have equal length and equal elements.

Type Parameters

T

The element type.

ValueEquals<T>(IValueEqualityComparer<T>, T[]?, T[]?)

Determines whether two arrays contain the same value elements, using the by-reference comparer.

public static bool ValueEquals<T>(this IValueEqualityComparer<T> comparer, T[]? x, T[]? y) where T : struct

Parameters

comparer IValueEqualityComparer<T>

The value comparer.

x T[]

The first array, or null.

y T[]

The second array, or null.

Returns

bool

true when both are null, or both have equal length and equal elements.

Type Parameters

T

The element type.