public static IReadOnlyEntityType?GetClosestCommonParent([NotNull] this IReadOnlyEntityType entityType1, [NotNull] IReadOnlyEntityType entityType2) { Check.NotNull(entityType1, nameof(entityType1)); Check.NotNull(entityType2, nameof(entityType2)); return(entityType1 .GetAllBaseTypesInclusiveAscending() .FirstOrDefault(i => entityType2.GetAllBaseTypesInclusiveAscending().Any(j => j == i))); }
public static IEnumerable <IReadOnlyEntityType> GetAllBaseTypesAscending([NotNull] this IReadOnlyEntityType entityType) => entityType.GetAllBaseTypesInclusiveAscending().Skip(1);