共用方式為


ConventionPropertyExtensions.SetValueComparer 方法

定義

設定這個屬性的自訂 ValueComparer

public static void SetValueComparer (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer comparer, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer SetValueComparer (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer comparer, bool fromDataAnnotation = false);
static member SetValueComparer : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * bool -> unit
static member SetValueComparer : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * bool -> Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer
<Extension()>
Public Sub SetValueComparer (property As IConventionProperty, comparer As ValueComparer, Optional fromDataAnnotation As Boolean = false)
<Extension()>
Public Function SetValueComparer (property As IConventionProperty, comparer As ValueComparer, Optional fromDataAnnotation As Boolean = false) As ValueComparer

參數

property
IConventionProperty

屬性。

comparer
ValueComparer

比較子,或 null 移除任何先前設定的比較子。

fromDataAnnotation
Boolean

指出是否使用資料批註來指定組態。

傳回

已設定的值。

適用於