CoreStrings.PrimaryKeyAttributeOnDerivedEntity(Object, Object) 方法

定义

派生类型“{derivedType}”不能具有 [PrimaryKey] 属性,因为主键只能在根类型上声明。 将特性移动到“{rootType}”,或使用 [NotMapped] 属性或调用“OnModelCreating”中基类型上的“EntityTypeBuilder.Ignore”从模型中删除“{rootType}”。

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

参数

derivedType
Object
rootType
Object

返回

适用于