語言

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

傳回

適用於