Partager via


IConventionEntityType.SetPrimaryKey Méthode

Définition

Surcharges

SetPrimaryKey(IReadOnlyList<IConventionProperty>, Boolean)

Définit la clé primaire pour ce type d’entité.

SetPrimaryKey(IConventionProperty, Boolean)

Définit la clé primaire pour ce type d’entité.

SetPrimaryKey(IReadOnlyList<IConventionProperty>, Boolean)

Définit la clé primaire pour ce type d’entité.

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

Paramètres

properties
IReadOnlyList<IConventionProperty>

Propriétés qui composent la clé primaire.

fromDataAnnotation
Boolean

Indique si la configuration a été spécifiée à l’aide d’une annotation de données.

Retours

Clé nouvellement créée.

S’applique à

SetPrimaryKey(IConventionProperty, Boolean)

Définit la clé primaire pour ce type d’entité.

public virtual Microsoft.EntityFrameworkCore.Metadata.IConventionKey SetPrimaryKey (Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, bool fromDataAnnotation = false);
public virtual Microsoft.EntityFrameworkCore.Metadata.IConventionKey? SetPrimaryKey (Microsoft.EntityFrameworkCore.Metadata.IConventionProperty? property, bool fromDataAnnotation = false);
abstract member SetPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionKey
override this.SetPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionKey
Public Overridable Function SetPrimaryKey (property As IConventionProperty, Optional fromDataAnnotation As Boolean = false) As IConventionKey

Paramètres

property
IConventionProperty

Propriété de clé primaire.

fromDataAnnotation
Boolean

Indique si la configuration a été spécifiée à l’aide d’une annotation de données.

Retours

Clé nouvellement créée.

S’applique à