Table of Contents

Class IndexComparer

Namespace
Microsoft.EntityFrameworkCore.Metadata
Assembly
Microsoft.EntityFrameworkCore.dll

An implementation of IComparer<T> and IEqualityComparer<T> to compare IReadOnlyIndex instances.

This type is typically used by database providers (and other extensions). It is generally not used in application code.

public sealed class IndexComparer : IEqualityComparer<IReadOnlyIndex>, IComparer<IReadOnlyIndex>
Inheritance
IndexComparer
Implements
Inherited Members

Remarks

See Implementation of database providers and extensions for more information and examples.

Fields

Instance

The singleton instance of the comparer to use.

public static readonly IndexComparer Instance

Field Value

IndexComparer

Methods

Compare(IReadOnlyIndex?, IReadOnlyIndex?)

Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.

public int Compare(IReadOnlyIndex? x, IReadOnlyIndex? y)

Parameters

x IReadOnlyIndex

The first object to compare.

y IReadOnlyIndex

The second object to compare.

Returns

int

A negative number if 'x' is less than 'y'; a positive number if 'x' is greater than 'y'; zero otherwise.

Equals(IReadOnlyIndex?, IReadOnlyIndex?)

Determines whether the specified objects are equal.

public bool Equals(IReadOnlyIndex? x, IReadOnlyIndex? y)

Parameters

x IReadOnlyIndex

The first object to compare.

y IReadOnlyIndex

The second object to compare.

Returns

bool

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

GetHashCode(IReadOnlyIndex)

Returns a hash code for the specified object.

public int GetHashCode(IReadOnlyIndex obj)

Parameters

obj IReadOnlyIndex

The for which a hash code is to be returned.

Returns

int

A hash code for the specified object.