Langue

CoreStrings.PrimaryKeyAttributeOnDerivedEntity(Object, Object) Méthode

Définition

Le type dérivé « {derivedType} » ne peut pas avoir l’attribut [PrimaryKey], car les clés primaires peuvent uniquement être déclarées sur le type racine. Déplacez l’attribut vers « {rootType} » ou supprimez « {rootType} » du modèle à l’aide de l’attribut [NotMapped] ou appelez « EntityTypeBuilder.Ignore » sur le type de base « OnModelCreating ».

public static string PrimaryKeyAttributeOnDerivedEntity(object? derivedType, object? rootType);
static member PrimaryKeyAttributeOnDerivedEntity : obj * obj -> string
Public Shared Function PrimaryKeyAttributeOnDerivedEntity (derivedType As Object, rootType As Object) As String

Paramètres

derivedType
Object
rootType
Object

Retours

S’applique à