EntityTypeExtensions.GetClosestCommonParent(IEntityType, IEntityType) Method

Definition

Caution

Use IReadOnlyEntityType.FindClosestCommonParent

Returns the closest entity type that is a parent of both given entity types. If one of the given entities is a parent of the other, that parent is returned. Returns null if the two entity types aren't in the same hierarchy.

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

Parameters

entityType1
IEntityType

An entity type.

entityType2
IEntityType

Another entity type.

Returns

The closest common parent of entityType1 and entityType2, or null if they have not common parent.

Attributes

Applies to