MutableEntityTypeExtensions.RemoveForeignKey Method
Definition
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.
Removes a foreign key from this entity type.
public static Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey RemoveForeignKey (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> properties, Microsoft.EntityFrameworkCore.Metadata.IMutableKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType principalEntityType);
static member RemoveForeignKey : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> * Microsoft.EntityFrameworkCore.Metadata.IMutableKey * Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType -> Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey
<Extension()>
Public Function RemoveForeignKey (entityType As IMutableEntityType, properties As IReadOnlyList(Of IMutableProperty), principalKey As IMutableKey, principalEntityType As IMutableEntityType) As IMutableForeignKey
Parameters
- entityType
- IMutableEntityType
The entity type.
- properties
- IReadOnlyList<IMutableProperty>
The properties that the foreign key is defined on.
- principalKey
- IMutableKey
The primary or alternate key that is referenced.
- principalEntityType
- IMutableEntityType
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
Entity Framework