CoreStrings.ForeignKeyPropertyInKey(Object, Object, Object, Object) Method

Definition

The property '{property}' cannot be part of a foreign key on '{entityType}' because it has a store-generated value and is contained in the key {keyProperties} defined on a base entity type '{baseEntityType}'. Configure '{property}' with 'ValueGeneratedNever' or define the foreign key on '{entityType}' instead.

C#
public static string ForeignKeyPropertyInKey (object property, object entityType, object key, object baseEntityType);
C#
public static string ForeignKeyPropertyInKey (object property, object entityType, object keyProperties, object baseEntityType);
C#
public static string ForeignKeyPropertyInKey (object? property, object? entityType, object? keyProperties, object? baseEntityType);

Parameters

property
Object
entityType
Object
keykeyProperties
Object
baseEntityType
Object

Returns

Applies to

Product Versions
Entity Framework Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0