コード例 #1
0
        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)));
        }
コード例 #2
0
 public static IEnumerable <IReadOnlyEntityType> GetAllBaseTypesAscending([NotNull] this IReadOnlyEntityType entityType)
 => entityType.GetAllBaseTypesInclusiveAscending().Skip(1);