IReadOnlyEntityType.FindForeignKey 方法

定义

重载

FindForeignKey(IReadOnlyProperty, IReadOnlyKey, IReadOnlyEntityType)

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

FindForeignKey(IReadOnlyList<IReadOnlyProperty>, IReadOnlyKey, IReadOnlyEntityType)

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

FindForeignKey(IReadOnlyProperty, IReadOnlyKey, IReadOnlyEntityType)

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

public virtual Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey? 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.IReadOnlyForeignKey
override this.FindForeignKey : Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType -> Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey
Public Overridable Function FindForeignKey (property As IReadOnlyProperty, principalKey As IReadOnlyKey, principalEntityType As IReadOnlyEntityType) As IReadOnlyForeignKey

参数

property
IReadOnlyProperty

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

principalKey
IReadOnlyKey

引用的主键或备用键。

principalEntityType
IReadOnlyEntityType

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

返回

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

适用于

FindForeignKey(IReadOnlyList<IReadOnlyProperty>, IReadOnlyKey, IReadOnlyEntityType)

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

public Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey? 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.IReadOnlyForeignKey
Public Function FindForeignKey (properties As IReadOnlyList(Of IReadOnlyProperty), principalKey As IReadOnlyKey, principalEntityType As IReadOnlyEntityType) As IReadOnlyForeignKey

参数

properties
IReadOnlyList<IReadOnlyProperty>

定义外键的属性。

principalKey
IReadOnlyKey

引用的主键或备用键。

principalEntityType
IReadOnlyEntityType

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

返回

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

适用于