共用方式為


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 可以針對這個屬性進行設定,則為 。

屬性

適用於