IConventionProperty.SetValueComparer Method

Definition

Overloads

SetValueComparer(ValueComparer, Boolean)

Sets the custom ValueComparer for this property.

SetValueComparer(Type, Boolean)

Sets the custom ValueComparer for this property.

SetValueComparer(ValueComparer, Boolean)

Source:
IConventionProperty.cs
Source:
IConventionProperty.cs
Source:
IConventionProperty.cs
Source:
IConventionProperty.cs

Sets the custom ValueComparer for this property.

C#
public Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? SetValueComparer (Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? comparer, bool fromDataAnnotation = false);

Parameters

comparer
ValueComparer

The comparer, or null to remove any previously set comparer.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The configured value.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 6.0, 7.0, 8.0, 9.0

SetValueComparer(Type, Boolean)

Source:
IConventionProperty.cs
Source:
IConventionProperty.cs
Source:
IConventionProperty.cs
Source:
IConventionProperty.cs

Sets the custom ValueComparer for this property.

C#
public Type? SetValueComparer (Type? comparerType, bool fromDataAnnotation = false);

Parameters

comparerType
Type

A type that inherits from ValueComparer, or null to remove any previously set comparer.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The configured value.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 6.0, 7.0, 8.0, 9.0