Table of Contents

Class ObjectListComparer<TElement>

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

A ValueComparer<T> for lists of primitive items. The list can be typed as IEnumerable<T>, but can only be used with instances that implement IList<T>.

public sealed class ObjectListComparer<TElement> : ValueComparer<IEnumerable<TElement>>, IEqualityComparer, IEqualityComparer<object>, IEqualityComparer<IEnumerable<TElement>>

Type Parameters

TElement

The element type.

Inheritance
ObjectListComparer<TElement>
Implements
Inherited Members
Extension Methods

Remarks

This comparer should be used when the element of the comparer is typed as object.

See EF Core value comparers for more information and examples.

Constructors

ObjectListComparer(ValueComparer)

Creates a new instance of the list comparer.

public ObjectListComparer(ValueComparer elementComparer)

Parameters

elementComparer ValueComparer

The comparer to use for comparing elements.

Properties

ElementComparer

The comparer to use for comparing elements.

public ValueComparer ElementComparer { get; }

Property Value

ValueComparer