共用方式為


KeyDiscoveryConvention.TryConfigurePrimaryKey 方法

定義

探索主鍵候選項目,並在找到時設定主鍵。

protected virtual void TryConfigurePrimaryKey (Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder);
abstract member TryConfigurePrimaryKey : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder -> unit
override this.TryConfigurePrimaryKey : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder -> unit
Protected Overridable Sub TryConfigurePrimaryKey (entityTypeBuilder As IConventionEntityTypeBuilder)

參數

entityTypeBuilder
IConventionEntityTypeBuilder

實體類型產生器。

適用於