IEntityType.FindForeignKey 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
FindForeignKey(IReadOnlyProperty, IReadOnlyKey, IReadOnlyEntityType) |
获取指向给定主键或备用键的给定属性的外键。 |
FindForeignKey(IReadOnlyList<IProperty>, IKey, IEntityType) |
获取指向给定主键或备用键的给定属性的外键。
|
FindForeignKey(IReadOnlyList<IReadOnlyProperty>, IReadOnlyKey, IReadOnlyEntityType) |
获取指向给定主键或备用键的给定属性的外键。
|
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
则为 。
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈