IEntityType.FindForeignKey 方法

定义

重载

FindForeignKey(IReadOnlyProperty, IReadOnlyKey, IReadOnlyEntityType)

获取指向给定主键或备用键的给定属性的外键。 null如果未找到外键,则返回 。

FindForeignKey(IReadOnlyList<IProperty>, IKey, IEntityType)

获取指向给定主键或备用键的给定属性的外键。 null如果未找到外键,则返回 。

FindForeignKey(IReadOnlyList<IReadOnlyProperty>, IReadOnlyKey, IReadOnlyEntityType)

获取指向给定主键或备用键的给定属性的外键。 null如果未找到外键,则返回 。

FindForeignKey(IReadOnlyProperty, IReadOnlyKey, IReadOnlyEntityType)

获取指向给定主键或备用键的给定属性的外键。 null如果未找到外键,则返回 。

public virtual Microsoft.EntityFrameworkCore.Metadata.IForeignKey? FindForeignKey (Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty property, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType principalEntityType);
abstract member FindForeignKey : Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType -> Microsoft.EntityFrameworkCore.Metadata.IForeignKey
override this.FindForeignKey : Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType -> Microsoft.EntityFrameworkCore.Metadata.IForeignKey
Public Overridable Function FindForeignKey (property As IReadOnlyProperty, principalKey As IReadOnlyKey, principalEntityType As IReadOnlyEntityType) As IForeignKey

参数

property
IReadOnlyProperty

定义外键时所基于的属性。

principalKey
IReadOnlyKey

引用的主键或备用键。

principalEntityType
IReadOnlyEntityType

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

返回

外键;如果未定义外键, null 则为 。

适用于

FindForeignKey(IReadOnlyList<IProperty>, IKey, IEntityType)

获取指向给定主键或备用键的给定属性的外键。 null如果未找到外键,则返回 。

public Microsoft.EntityFrameworkCore.Metadata.IForeignKey FindForeignKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IProperty> properties, Microsoft.EntityFrameworkCore.Metadata.IKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IEntityType principalEntityType);
abstract member FindForeignKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IProperty> * Microsoft.EntityFrameworkCore.Metadata.IKey * Microsoft.EntityFrameworkCore.Metadata.IEntityType -> Microsoft.EntityFrameworkCore.Metadata.IForeignKey
Public Function FindForeignKey (properties As IReadOnlyList(Of IProperty), principalKey As IKey, principalEntityType As IEntityType) As IForeignKey

参数

properties
IReadOnlyList<IProperty>

定义外键时的属性。

principalKey
IKey

引用的主键或备用键。

principalEntityType
IEntityType

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

返回

外键;如果未定义外键, null 则为 。

适用于

FindForeignKey(IReadOnlyList<IReadOnlyProperty>, IReadOnlyKey, IReadOnlyEntityType)

获取指向给定主键或备用键的给定属性的外键。 null如果未找到外键,则返回 。

public Microsoft.EntityFrameworkCore.Metadata.IForeignKey? FindForeignKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty> properties, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType principalEntityType);
abstract member FindForeignKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty> * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType -> Microsoft.EntityFrameworkCore.Metadata.IForeignKey
Public Function FindForeignKey (properties As IReadOnlyList(Of IReadOnlyProperty), principalKey As IReadOnlyKey, principalEntityType As IReadOnlyEntityType) As IForeignKey

参数

properties
IReadOnlyList<IReadOnlyProperty>

定义外键时的属性。

principalKey
IReadOnlyKey

引用的主键或备用键。

principalEntityType
IReadOnlyEntityType

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

返回

外键;如果未定义外键, null 则为 。

适用于