IConventionEntityType.SetPrimaryKey Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
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 à
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour