IConventionEntityType.RemoveForeignKey Method

Definition

Overloads

RemoveForeignKey(IConventionForeignKey)

Removes a foreign key from this entity type.

RemoveForeignKey(IReadOnlyForeignKey)

Removes a foreign key from this entity type.

RemoveForeignKey(IReadOnlyList<IReadOnlyProperty>, IConventionKey, IConventionEntityType)

Removes a foreign key from this entity type.

RemoveForeignKey(IConventionForeignKey)

Removes a foreign key from this entity type.

public void RemoveForeignKey (Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey foreignKey);
public Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey RemoveForeignKey (Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey foreignKey);
abstract member RemoveForeignKey : Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey -> unit
abstract member RemoveForeignKey : Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey -> Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey
Public Sub RemoveForeignKey (foreignKey As IConventionForeignKey)
Public Function RemoveForeignKey (foreignKey As IConventionForeignKey) As IConventionForeignKey

Parameters

foreignKey
IConventionForeignKey

The foreign key to be removed.

Returns

The removed foreign key.

Applies to

RemoveForeignKey(IReadOnlyForeignKey)

Removes a foreign key from this entity type.

public Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey? RemoveForeignKey (Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey foreignKey);
abstract member RemoveForeignKey : Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey -> Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey
Public Function RemoveForeignKey (foreignKey As IReadOnlyForeignKey) As IConventionForeignKey

Parameters

foreignKey
IReadOnlyForeignKey

The foreign key to be removed.

Returns

The removed foreign key, or null if the index was not found.

Applies to

RemoveForeignKey(IReadOnlyList<IReadOnlyProperty>, IConventionKey, IConventionEntityType)

Removes a foreign key from this entity type.

public Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey? RemoveForeignKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty> properties, Microsoft.EntityFrameworkCore.Metadata.IConventionKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType principalEntityType);
abstract member RemoveForeignKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty> * Microsoft.EntityFrameworkCore.Metadata.IConventionKey * Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType -> Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey
Public Function RemoveForeignKey (properties As IReadOnlyList(Of IReadOnlyProperty), principalKey As IConventionKey, principalEntityType As IConventionEntityType) As IConventionForeignKey

Parameters

properties
IReadOnlyList<IReadOnlyProperty>

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