Share via


ListOfValueTypesComparer<TConcreteList,TElement> Class

Definition

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>.

[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 0, 1, 0 })]
public sealed class ListOfValueTypesComparer<TConcreteList,TElement> : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer<System.Collections.Generic.IEnumerable<TElement>>, Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer> where TElement : struct
[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 0, 1, 0 })>]
type ListOfValueTypesComparer<'ConcreteList, 'Element (requires 'Element : struct)> = class
    inherit ValueComparer<seq<'Element>>
    interface IInfrastructure<ValueComparer>
Public NotInheritable Class ListOfValueTypesComparer(Of TConcreteList, TElement)
Inherits ValueComparer(Of IEnumerable(Of TElement))
Implements IInfrastructure(Of ValueComparer)

Type Parameters

TConcreteList

The collection type to create an index of, if needed.

TElement

The element type.

Inheritance
ListOfValueTypesComparer<TConcreteList,TElement>
Attributes
Implements

Remarks

This comparer should be used for reference types and non-nullable value types. Use ListOfNullableValueTypesComparer<TConcreteList,TElement> for nullable value types.

See EF Core value comparers for more information and examples.

Constructors

Name Description
ListOfValueTypesComparer<TConcreteList,TElement>(ValueComparer)

Creates a new instance of the list comparer.

Properties

Name Description
ConstructorExpression

The expression representing construction of this object.

(Inherited from ValueComparer<T>)
ElementComparer

The comparer to use for comparing elements.

EqualsExpression

The comparison expression.

(Inherited from ValueComparer<T>)
HashCodeExpression

The hash code expression.

(Inherited from ValueComparer<T>)
ObjectEqualsExpression

The object comparison expression.

(Inherited from ValueComparer<T>)
SnapshotExpression

The snapshot expression.

(Inherited from ValueComparer<T>)
Type

The type.

(Inherited from ValueComparer<T>)

Methods

Name Description
Equals(Object, Object)

Compares the two instances to determine if they are equal.

(Inherited from ValueComparer<T>)
Equals(T, T)

Compares the two instances to determine if they are equal.

(Inherited from ValueComparer<T>)
ExtractEqualsBody(Expression, Expression)

Takes EqualsExpression and replaces the two parameters with the given expressions, returning the transformed body.

(Inherited from ValueComparer)
ExtractHashCodeBody(Expression)

Takes the HashCodeExpression and replaces the parameter with the given expression, returning the transformed body.

(Inherited from ValueComparer)
ExtractSnapshotBody(Expression)

Takes the SnapshotExpression and replaces the parameter with the given expression, returning the transformed body.

(Inherited from ValueComparer)
GetHashCode(Object)

Returns the hash code for the given instance.

(Inherited from ValueComparer<T>)
GetHashCode(T)

Returns the hash code for the given instance.

(Inherited from ValueComparer<T>)
Snapshot(Object)

Creates a snapshot of the given instance.

(Inherited from ValueComparer<T>)
Snapshot(T)

Creates a snapshot of the given instance.

(Inherited from ValueComparer<T>)

Explicit Interface Implementations

Name Description
IInfrastructure<ValueComparer>.Instance

Extension Methods

Name Description
IsDefault(ValueComparer)

Returns true if the given ValueComparer is a default EF Core implementation.

GetInfrastructure<T>(IInfrastructure<T>)

Gets the value from a property that is being hidden using IInfrastructure<T>.

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

Applies to