IConventionPropertyBuilder.CanSetKeyValueComparer 方法

定义

注意

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

返回一个值,该值指示是否可以从当前配置源为此属性配置给定 ValueComparer 的 。

public bool CanSetKeyValueComparer (Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer comparer, bool fromDataAnnotation = false);
[System.Obsolete("Use CanSetValueComparer. Only a single value comparer is allowed for a given property.")]
public bool CanSetKeyValueComparer (Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer comparer, bool fromDataAnnotation = false);
[System.Obsolete("Use CanSetValueComparer. Only a single value comparer is allowed for a given property.")]
public bool CanSetKeyValueComparer (Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? comparer, bool fromDataAnnotation = false);
abstract member CanSetKeyValueComparer : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * bool -> bool
[<System.Obsolete("Use CanSetValueComparer. Only a single value comparer is allowed for a given property.")>]
abstract member CanSetKeyValueComparer : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * bool -> bool
Public Function CanSetKeyValueComparer (comparer As ValueComparer, Optional fromDataAnnotation As Boolean = false) As Boolean

参数

comparer
ValueComparer

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

fromDataAnnotation
Boolean

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

返回

true 如果可以为此属性配置给定 ValueComparer 的 ,则为 。

属性

适用于