Table of Contents

Class EntryCurrentValueComparer<TProperty>

Namespace
Microsoft.EntityFrameworkCore.ChangeTracking
Assembly
Microsoft.EntityFrameworkCore.dll

An implementation of IComparer<T> and IEqualityComparer<T> to compare current values contained in IUpdateEntry internal tracking entities.

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

public sealed class EntryCurrentValueComparer<TProperty> : IComparer<IUpdateEntry>, IEqualityComparer<IUpdateEntry>

Type Parameters

TProperty

The type of the property.

Inheritance
EntryCurrentValueComparer<TProperty>
Implements
Inherited Members

Remarks

See EF Core value comparers for more information and examples.

Constructors

EntryCurrentValueComparer(IPropertyBase)

Creates a new EntryCurrentValueComparer instance using a the default comparer for the property type.

public EntryCurrentValueComparer(IPropertyBase property)

Parameters

property IPropertyBase

The property to use for comparisons.

Methods

Compare(IUpdateEntry?, IUpdateEntry?)

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

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

Parameters

x IUpdateEntry

The first object to compare.

y IUpdateEntry

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(IUpdateEntry?, IUpdateEntry?)

Determines whether the specified objects are equal.

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

Parameters

x IUpdateEntry

The first object to compare.

y IUpdateEntry

The second object to compare.

Returns

bool

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

GetHashCode(IUpdateEntry)

Returns a hash code for the specified object.

public int GetHashCode(IUpdateEntry obj)

Parameters

obj IUpdateEntry

The for which a hash code is to be returned.

Returns

int

A hash code for the specified object.