CoreStrings.KeyInUse Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
KeyInUse(Object, Object, Object) |
Cannot remove key {key} from entity type '{entityType}' because it is referenced by a foreign key in entity type '{dependentType}'. All foreign keys must be removed or redefined before the referenced key can be removed. |
KeyInUse(Object, Object, Object, Object) |
Cannot remove key {keyProperties} from entity type '{entityType}' because it is referenced by a foreign key {foreignKeyProperties} defined on entity type '{dependentType}'. Remove or change the principal key for all referencing foreign keys before removing the key. |
- Source:
- CoreStrings.Designer.cs
- Source:
- CoreStrings.Designer.cs
Cannot remove key {key} from entity type '{entityType}' because it is referenced by a foreign key in entity type '{dependentType}'. All foreign keys must be removed or redefined before the referenced key can be removed.
public static string KeyInUse (object key, object entityType, object dependentType);
static member KeyInUse : obj * obj * obj -> string
Public Shared Function KeyInUse (key As Object, entityType As Object, dependentType As Object) As String
Parameters
- key
- Object
- entityType
- Object
- dependentType
- Object
Returns
Applies to
Entity Framework Core 3.1 and Entity Framework Core 3.0
Product | Versions |
---|---|
Entity Framework Core | 3.0, 3.1 |
- Source:
- CoreStrings.Designer.cs
- Source:
- CoreStrings.Designer.cs
- Source:
- CoreStrings.Designer.cs
- Source:
- CoreStrings.Designer.cs
- Source:
- CoreStrings.Designer.cs
Cannot remove key {keyProperties} from entity type '{entityType}' because it is referenced by a foreign key {foreignKeyProperties} defined on entity type '{dependentType}'. Remove or change the principal key for all referencing foreign keys before removing the key.
public static string KeyInUse (object keyProperties, object entityType, object foreignKeyProperties, object dependentType);
public static string KeyInUse (object? keyProperties, object? entityType, object? foreignKeyProperties, object? dependentType);
static member KeyInUse : obj * obj * obj * obj -> string
Public Shared Function KeyInUse (keyProperties As Object, entityType As Object, foreignKeyProperties As Object, dependentType As Object) As String
Parameters
- keyProperties
- Object
- entityType
- Object
- foreignKeyProperties
- Object
- dependentType
- Object
Returns
Applies to
Entity Framework Core 9.0 and other versions
Product | Versions |
---|---|
Entity Framework Core | 5.0, 6.0, 7.0, 8.0, 9.0 |
Entity Framework feedback
Entity Framework is an open source project. Select a link to provide feedback: