Share via


CoreStrings.PrimaryKeyAttributeOnDerivedEntity(Object, Object) Method

Definition

The derived type '{derivedType}' cannot have the [PrimaryKey] attribute since primary keys may only be declared on the root type. Move the attribute to '{rootType}', or remove '{rootType}' from the model by using [NotMapped] attribute or calling 'EntityTypeBuilder.Ignore' on the base type in '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

Parameters

derivedType
Object
rootType
Object

Returns

Applies to