Udostępnij za pośrednictwem


CoreStrings.PrimaryKeyAttributeOnDerivedEntity(Object, Object) Metoda

Definicja

Typ pochodny "{derivedType}" nie może mieć atrybutu [PrimaryKey], ponieważ klucze podstawowe mogą być deklarowane tylko w typie głównym. Przenieś atrybut do elementu "{rootType}" lub usuń element "{rootType}" z modelu przy użyciu atrybutu [NotMapped] lub wywołaj metodę "EntityTypeBuilder.Ignore" na podstawie typu podstawowego w elemencie "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

Parametry

derivedType
Object
rootType
Object

Zwraca

Dotyczy