IMutableEntityType.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.
Overloads
RemoveForeignKey(IMutableForeignKey) |
Removes a foreign key from this entity type. |
RemoveForeignKey(IReadOnlyForeignKey) |
Removes a foreign key from this entity type. |
RemoveForeignKey(IReadOnlyList<IProperty>, IKey, IEntityType) |
Removes a relationship from this entity. |
RemoveForeignKey(IReadOnlyList<IReadOnlyProperty>, IMutableKey, IMutableEntityType) |
Removes a foreign key from this entity type. |
RemoveForeignKey(IMutableForeignKey)
Removes a foreign key from this entity type.
public void RemoveForeignKey (Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey foreignKey);
public Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey RemoveForeignKey (Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey foreignKey);
abstract member RemoveForeignKey : Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey -> unit
abstract member RemoveForeignKey : Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey -> Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey
Public Sub RemoveForeignKey (foreignKey As IMutableForeignKey)
Public Function RemoveForeignKey (foreignKey As IMutableForeignKey) As IMutableForeignKey
Parameters
- foreignKey
- IMutableForeignKey
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.IMutableForeignKey? RemoveForeignKey (Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey foreignKey);
abstract member RemoveForeignKey : Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey -> Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey
Public Function RemoveForeignKey (foreignKey As IReadOnlyForeignKey) As IMutableForeignKey
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<IProperty>, IKey, IEntityType)
Removes a relationship from this entity.
public Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey RemoveForeignKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IProperty> properties, Microsoft.EntityFrameworkCore.Metadata.IKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IEntityType principalEntityType);
abstract member RemoveForeignKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IProperty> * Microsoft.EntityFrameworkCore.Metadata.IKey * Microsoft.EntityFrameworkCore.Metadata.IEntityType -> Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey
Public Function RemoveForeignKey (properties As IReadOnlyList(Of IProperty), principalKey As IKey, principalEntityType As IEntityType) As IMutableForeignKey
Parameters
- properties
- IReadOnlyList<IProperty>
The properties that the foreign key is defined on.
- principalKey
- IKey
The primary or alternate key that is referenced.
- principalEntityType
- IEntityType
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
RemoveForeignKey(IReadOnlyList<IReadOnlyProperty>, IMutableKey, IMutableEntityType)
Removes a foreign key from this entity type.
public Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey? RemoveForeignKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty> properties, Microsoft.EntityFrameworkCore.Metadata.IMutableKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType principalEntityType);
abstract member RemoveForeignKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty> * Microsoft.EntityFrameworkCore.Metadata.IMutableKey * Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType -> Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey
Public Function RemoveForeignKey (properties As IReadOnlyList(Of IReadOnlyProperty), principalKey As IMutableKey, principalEntityType As IMutableEntityType) As IMutableForeignKey
Parameters
- properties
- IReadOnlyList<IReadOnlyProperty>
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 removed foreign key, or null
if the index was not found.
Applies to
Entity Framework