EntityTypeExtensions.GetClosestCommonParent(IEntityType, IEntityType) 方法

定义

注意

Use IReadOnlyEntityType.FindClosestCommonParent

返回最接近的实体类型,该类型是两个给定实体类型的父级。 如果其中一个给定实体是另一个实体的父实体,则返回该父实体。 null如果两个实体类型不在同一层次结构中,则返回 。

public static Microsoft.EntityFrameworkCore.Metadata.IEntityType GetClosestCommonParent (this Microsoft.EntityFrameworkCore.Metadata.IEntityType entityType1, Microsoft.EntityFrameworkCore.Metadata.IEntityType entityType2);
[System.Obsolete("Use IReadOnlyEntityType.FindClosestCommonParent")]
public static Microsoft.EntityFrameworkCore.Metadata.IEntityType? GetClosestCommonParent (this Microsoft.EntityFrameworkCore.Metadata.IEntityType entityType1, Microsoft.EntityFrameworkCore.Metadata.IEntityType entityType2);
static member GetClosestCommonParent : Microsoft.EntityFrameworkCore.Metadata.IEntityType * Microsoft.EntityFrameworkCore.Metadata.IEntityType -> Microsoft.EntityFrameworkCore.Metadata.IEntityType
[<System.Obsolete("Use IReadOnlyEntityType.FindClosestCommonParent")>]
static member GetClosestCommonParent : Microsoft.EntityFrameworkCore.Metadata.IEntityType * Microsoft.EntityFrameworkCore.Metadata.IEntityType -> Microsoft.EntityFrameworkCore.Metadata.IEntityType
<Extension()>
Public Function GetClosestCommonParent (entityType1 As IEntityType, entityType2 As IEntityType) As IEntityType

参数

entityType1
IEntityType

一个实体类型。

entityType2
IEntityType

另一个实体类型。

返回

entityType2的最接近的公共父级entityType1,如果它们没有公共父级,则为 null。

属性

适用于