Share via


ConventionEntityTypeExtensions.SetPrimaryKey Metodo

Definizione

Imposta la chiave primaria per questo tipo di entità.

public static Microsoft.EntityFrameworkCore.Metadata.IConventionKey SetPrimaryKey (this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType, Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, bool fromDataAnnotation = false);
static member SetPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionKey
<Extension()>
Public Function SetPrimaryKey (entityType As IConventionEntityType, property As IConventionProperty, Optional fromDataAnnotation As Boolean = false) As IConventionKey

Parametri

entityType
IConventionEntityType

Tipo di entità su cui impostare la chiave.

property
IConventionProperty

Proprietà della chiave primaria.

fromDataAnnotation
Boolean

Indica se la configurazione è stata specificata utilizzando un'annotazione dati.

Restituisce

Chiave appena creata.

Si applica a