IConventionEntityTypeBuilder.PrimaryKey 方法

定義

多載

PrimaryKey(IReadOnlyList<IConventionProperty>, Boolean)

設定構成此實體類型主鍵的屬性。

PrimaryKey(IReadOnlyList<String>, Boolean)

設定構成此實體類型主鍵的屬性。

PrimaryKey(IReadOnlyList<IConventionProperty>, Boolean)

設定構成此實體類型主鍵的屬性。

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

參數

properties
IReadOnlyList<IConventionProperty>

組成主鍵的屬性。

fromDataAnnotation
Boolean

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

傳回

物件,可用來設定主鍵。

適用於

PrimaryKey(IReadOnlyList<String>, Boolean)

設定構成此實體類型主鍵的屬性。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionKeyBuilder? PrimaryKey (System.Collections.Generic.IReadOnlyList<string>? propertyNames, bool fromDataAnnotation = false);
abstract member PrimaryKey : System.Collections.Generic.IReadOnlyList<string> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionKeyBuilder
Public Function PrimaryKey (propertyNames As IReadOnlyList(Of String), Optional fromDataAnnotation As Boolean = false) As IConventionKeyBuilder

參數

propertyNames
IReadOnlyList<String>

組成主鍵的屬性名稱。

fromDataAnnotation
Boolean

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

傳回

物件,可用來設定主鍵。

適用於