CoreStrings.PrimaryKeyDefinedOnIgnoredProperty(Object, Object) Method

Definition

The [PrimaryKey] attribute on the entity type '{entityType}' is invalid because the property '{propertyName}' was marked as unmapped by [NotMapped] attribute or 'Ignore()' in 'OnModelCreating'. A primary key cannot use unmapped properties.

C#
public static string PrimaryKeyDefinedOnIgnoredProperty (object? entityType, object? propertyName);

Parameters

entityType
Object
propertyName
Object

Returns

Applies to

Product Versions
Entity Framework Core 7.0, 8.0, 9.0