IConventionEntityTypeBuilder.CanSetPrimaryKey 方法

定義

多載

CanSetPrimaryKey(IReadOnlyList<IConventionProperty>, Boolean)

傳回值,指出指定的屬性是否可以設定為此實體類型的主鍵。

CanSetPrimaryKey(IReadOnlyList<String>, Boolean)

傳回值,指出指定的屬性是否可以設定為此實體類型的主鍵。

CanSetPrimaryKey(IReadOnlyList<IConventionProperty>, Boolean)

傳回值,指出指定的屬性是否可以設定為此實體類型的主鍵。

public bool CanSetPrimaryKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool fromDataAnnotation = false);
public bool CanSetPrimaryKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty>? properties, bool fromDataAnnotation = false);
abstract member CanSetPrimaryKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * bool -> bool
Public Function CanSetPrimaryKey (properties As IReadOnlyList(Of IConventionProperty), Optional fromDataAnnotation As Boolean = false) As Boolean

參數

properties
IReadOnlyList<IConventionProperty>

組成主鍵的屬性。

fromDataAnnotation
Boolean

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

傳回

true 如果指定的屬性可以設定為主鍵,則為 。

適用於

CanSetPrimaryKey(IReadOnlyList<String>, Boolean)

傳回值,指出指定的屬性是否可以設定為此實體類型的主鍵。

public bool CanSetPrimaryKey (System.Collections.Generic.IReadOnlyList<string> propertyNames, bool fromDataAnnotation = false);
abstract member CanSetPrimaryKey : System.Collections.Generic.IReadOnlyList<string> * bool -> bool
Public Function CanSetPrimaryKey (propertyNames As IReadOnlyList(Of String), Optional fromDataAnnotation As Boolean = false) As Boolean

參數

propertyNames
IReadOnlyList<String>

組成索引的屬性名稱。

fromDataAnnotation
Boolean

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

傳回

true 如果指定的屬性可以設定為主鍵,則為 。

適用於