共用方式為


IConventionPropertyBuilder.HasKeyValueComparer(ValueComparer, Boolean) 方法

定義

警告

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

設定 ValueComparer 要用於此屬性之索引鍵比較的 。

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

參數

comparer
ValueComparer

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

fromDataAnnotation
Boolean

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

傳回

如果已套用組態,則為相同的產生器實例, null 否則為 。

屬性

適用於