共用方式為


CoreStrings.PrimaryKeyAttributeOnDerivedEntity(Object, Object) 方法

定義

衍生類型 '{derivedType}' 不能有 [PrimaryKey] 屬性,因為主鍵只能宣告在根類型上。 使用 [NotMapped] 屬性或呼叫 'EntityTypeBuilder.Ignore' 在 'OnModelCreating' 的基底類型上,將屬性移至 '{rootType}',或從模型中移除 '{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

傳回

適用於