ConventionEntityTypeExtensions.RemoveForeignKey Method

Definition

Removes a foreign key from this entity type.

public static Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey RemoveForeignKey (this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType, System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, Microsoft.EntityFrameworkCore.Metadata.IConventionKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType principalEntityType);
static member RemoveForeignKey : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * Microsoft.EntityFrameworkCore.Metadata.IConventionKey * Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType -> Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey
<Extension()>
Public Function RemoveForeignKey (entityType As IConventionEntityType, properties As IReadOnlyList(Of IConventionProperty), principalKey As IConventionKey, principalEntityType As IConventionEntityType) As IConventionForeignKey

Parameters

entityType
IConventionEntityType

The entity type.

properties
IReadOnlyList<IConventionProperty>

The properties that the foreign key is defined on.

principalKey
IConventionKey

The primary or alternate key that is referenced.

principalEntityType
IConventionEntityType

The entity type that the relationship targets. This may be different from the type that principalKey is defined on when the relationship targets a derived type in an inheritance hierarchy (since the key is defined on the base type of the hierarchy).

Returns

The foreign key that was removed.

Applies to