ConventionPropertyExtensions.SetKeyValueComparer 方法

定义

注意

Use SetValueComparer. Only a single value comparer is allowed for a given property.

在执行键比较时,为此属性设置自定义 ValueComparer

public static void SetKeyValueComparer (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer comparer, bool fromDataAnnotation = false);
[System.Obsolete("Use SetValueComparer. Only a single value comparer is allowed for a given property.")]
public static void SetKeyValueComparer (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer comparer, bool fromDataAnnotation = false);
[System.Obsolete("Use SetValueComparer. Only a single value comparer is allowed for a given property.")]
public static void SetKeyValueComparer (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? comparer, bool fromDataAnnotation = false);
static member SetKeyValueComparer : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * bool -> unit
[<System.Obsolete("Use SetValueComparer. Only a single value comparer is allowed for a given property.")>]
static member SetKeyValueComparer : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * bool -> unit
<Extension()>
Public Sub SetKeyValueComparer (property As IConventionProperty, comparer As ValueComparer, Optional fromDataAnnotation As Boolean = false)

参数

property
IConventionProperty

属性。

comparer
ValueComparer

比较器,或者 null 删除任何以前设置的比较器。

fromDataAnnotation
Boolean

指示配置是否是使用数据注释指定的。

属性

适用于