MutableEntityTypeExtensions.RemoveForeignKey 方法

定义

从此实体类型中删除外键。

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

参数

entityType
IMutableEntityType

实体类型。

properties
IReadOnlyList<IMutableProperty>

定义外键的属性。

principalKey
IMutableKey

引用的主键或备用键。

principalEntityType
IMutableEntityType

作为关系目标的实体类型。 这可能不同于关系面向继承层次结构 (派生类型时定义的类型 principalKey ,因为键是在层次结构) 基类型上定义的。

返回

已删除的外键。

适用于